Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
I have a dataset below.
I need to calculated median per year and have category as a slicer (If slicer is selected, median to be changed per slicer otherwise median per year).
For eg. When I use allexcept, the median remains static does not change with the slicer settings, I want static median value per year that changes dynamically with slicer.
Category | Year | Time in Days |
A | 2018 | 125 |
B | 2018 | 129 |
C | 2019 | 147 |
A | 2019 | 234 |
B | 2018 | 367 |
C | 2019 | 456 |
A | 2019 | 55 |
B | 2018 | 98 |
C | 2018 | 84 |
Solved! Go to Solution.
Hi @bharosha
please try
MedianMeasure =
CALCULATE (
MEDIAN ( 'Table'[Time in Days] ),
ALLSELECTED (),
VALUES ( 'Table'[Year] )
)
Hi @bharosha
please try
MedianMeasure =
CALCULATE (
MEDIAN ( 'Table'[Time in Days] ),
ALLSELECTED (),
VALUES ( 'Table'[Year] )
)