Ignore filters in measure
Matthew Barrera
I've this Measure in Power BI to calculate the average value ignoring low values (lower than the complete average previously calculated)
Measure = var T1 = SUMMARIZE(RAD,RAD[deviceid],"SUMDEVICE",SUM(RAD[data])) VAR AVGDEVICE = AVERAGEX(T1,[SUMDEVICE]) RETURN AVERAGEX(T1, IF([SUMDEVICE]>=AVGDEVICE,[SUMDEVICE]))/1000In this page I have two slices, one to select a time range and other to select a device. In this case, for this measure I want to ignore the device filter from the slicer, only with the date filter.
The RAD table is simple, and it is something like this, I have 4 devices and data for all the days of the year:
| Date | DeviceId | Data |
|---|---|---|
| 01/01/2022 | A | 100 |
| 01/01/2022 | B | 120 |
| 01/01/2022 | C | 90 |
| 01/01/2022 | D | 74 |
I can't find how to ignore this filter and have a fixed value for the selected time range in the slicer.
Thanks!
1 Answer
Try this one.
Measure =
var T1 = CALCULATETABLE( SUMMARIZE(RAD,RAD[deviceid],"SUMDEVICE",SUM(RAD[data])) ,ALL(RAD[deviceid]) -- works if the slicer is of this column or change to the proper tableName[columName] )
VAR AVGDEVICE = AVERAGEX(T1,[SUMDEVICE])
RETURN AVERAGEX( FILTER( T1 ,[SUMDEVICE]>=AVGDEVICE ) ,[SUMDEVICE] )/1000 7