Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I'm trying to plot the median value of counts for 'SC' category based on selection of 'deposit balance group' category on a bar chart. I created a measure using DAX which can calculate the median values. But it looks like my DAX formula is wrong and it's calculating the median for the entire table and not per category.
For Eg, The median value for $100K-$150K group for 'CD' category should be 36, but its showing 270 on the bar chart.
My sample data:
count | SC | Deposit Balance Group |
20 | CD | GT $2M |
18 | CD | $150K-$200K |
12 | CD | $200K-$250K |
42 | CD | $200K-$250K |
17 | CK | $100K-$150K |
11 | CK | $100K-$150K |
11 | CK | $100K-$150K |
17 | CK | $100K-$150K |
47 | CK | $100K-$150K |
The DAX measure I created:
Measure =
MEDIANX (
SUMMARIZE (
Sheet1,
Sheet1[SC],
"Total Count", SUM ( Sheet1[count] )
),
[Total Count]
)
Please let me know how can I overcome this situation.
Thanks
I've attached the pbix file which has the complete data and measure formula: pbix file
Solved! Go to Solution.
Hi @Anonymous -
You're over-thinking it 😊. By doing a Summarize you are totalling all of the counts and then performing MEDIAN on a single value. You would do something similar if you needed to count up the records from raw data, but since you already have the counts, all your measure needs is MEDIAN()
Hope this helps
David
Hi @Anonymous -
You're over-thinking it 😊. By doing a Summarize you are totalling all of the counts and then performing MEDIAN on a single value. You would do something similar if you needed to count up the records from raw data, but since you already have the counts, all your measure needs is MEDIAN()
Hope this helps
David
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
12 | |
9 | |
9 | |
9 |
User | Count |
---|---|
18 | |
14 | |
13 | |
13 | |
12 |