The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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] )
)
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |