Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
this Measure get me the median based on Slicer Selection, Country
IF ( ROUND(MEDIAN(vwKPIMedianDoorToCT[Minutes]),1) = BLANK (), 0, ROUND(MEDIAN(vwKPIMedianDoorToCT[Minutes]),1) )
I want to ignore the country , and also return the median for all countries , for comparison
?? --
Solved! Go to Solution.
Hi,
According to your description, I can roughly understand your requirement, you can try this measure:
Median =
var _value=MEDIANX(ALL(vwKPIMedianDoorToCT),[Minutes])
return
IF(_value=BLANK(),0,ROUND(_value,1))
Then you can create a slicer and a card chart to place this measure, and you will find that the measure will always display the value of the total median regardless of the selection of the slicer:
And you can get what you want.
You can download my test pbix file below
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
According to your description, I can roughly understand your requirement, you can try this measure:
Median =
var _value=MEDIANX(ALL(vwKPIMedianDoorToCT),[Minutes])
return
IF(_value=BLANK(),0,ROUND(_value,1))
Then you can create a slicer and a card chart to place this measure, and you will find that the measure will always display the value of the total median regardless of the selection of the slicer:
And you can get what you want.
You can download my test pbix file below
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This does not appear to be working ,
If I select all countries , 2021 Q1 Median is 75
If I select 1 country , (I want to igore this slicer) , it is 30 , ( I want to illustrate 75 regardless of country selection) but to still filter based on Date
If you want to ignore a slicer, then you need to use ALL instead of ALLSELECTED.
See if this is any closer:
CALCULATE (
MEDIAN ( vwKPIMedianDoorToCT[Minutes] ),
ALL ( vwKPIMedianDoorToCT ),
DimDate
)
thanks
Looks simple when coded
Great thanks
Looks simple when written !
I'd try writing it like this:
VAR MedianAllCountries =
CALCULATE ( MEDIAN ( vwKPIMedianDoorToCT[Minutes] ), ALLSELECTED () )
RETURN
IF ( ISBLANK ( MedianAllCountries ), 0, ROUND ( MedianAllCountries, 1 ) )
Great thanks
If I want to ignore all slicer but the Date dimension , having issues with e[Quarter]))) brackets
You can add back in the tables you want to keep as filter context like this:
CALCULATE ( MEDIAN ( vwKPIMedianDoorToCT[Minutes] ), ALLSELECTED (), DimDate )
Alternatively, use ALLSELECTED more narrowly only on the things you want to remove local filter context for. For example,
CALCULATE ( MEDIAN ( vwKPIMedianDoorToCT[Minutes] ), ALLSELECTED ( Slicer[Country] ) )
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
24 | |
21 | |
19 | |
14 | |
11 |
User | Count |
---|---|
43 | |
35 | |
25 | |
24 | |
22 |