0
votes

I tried to create a measure which should calculate the average number of the selected regions (via Chiclet Slicer).

enter image description here

If there is no filter set it should take the value of the whole country (CH - which is also part of this table).

In terms of logic, it should read something like this: If FilterIsActive take the average of median_R_mean of the selected regions else select the median_R_mean of "CH".

I have tried this : 

RE = 
IF(
    ISFILTERED(Region[Bezeichnung]), 
    AVERAGE(COVID19Re_geoRegion_Last_value[median_R_mean]), 
    FILTER(
        COVID19Re_geoRegion_Last_value, 
        "CH"
    )
)

Unfortunately this approach does not work. Can anyone help me on what possible approach I can follow here?

1

1 Answers

1
votes

If I understand your issue correct, you are looking for a measure as below-

RE = 
IF(
    ISFILTERED(Region[Bezeichnung]), 
    AVERAGE(COVID19Re_geoRegion_Last_value[median_R_mean]), 
    AVERAGEX(
        FILTER(
            ALL(COVID19Re_geoRegion_Last_value), 
            COVID19Re_geoRegion_Last_value[geoRegion] = "CH"
        ),
        COVID19Re_geoRegion_Last_value[median_R_mean]
    )    
)