Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi community,
I've created this Rank Measure
My aim is to Bin the ranked customers into the correct buckets but this is what I get once I remove the customer ID column.
Any ideas why? or how to fix this? Not sure why the buckets isnt working as expected.
Wrong result:
I'm expecting to see the below, once the Customer ID is removed.
Many thanks.
Solved! Go to Solution.
So to summarize the solution for anyone who may need it in the future.
The aim was to generate the following Pareto Graph.
Customers are ranked based on their spend (dynamic filters applied). Then grouped into 1-100 bins based on their rank.
Each bar represent the total spend per group.
So having created rank, based on the individuals spend. Then I needed 2 measures.
1. I created the following measure, to group the total sales by rank bin. I've included a screenshot of the DimRank table I created. It is an unconnected table.
(For some reason the measure didn't work when I tried to simplify my dax any further/using variables so there is some repetition)
DimRank table looks like:
Then I created the second measure, using the previous measure I created:
This measure is then used in the line/bar chart in column values.
Please note, it may look like "rankingid>=VALUES(DimRank[Lower])&&rankingid<=VALUES(DimRank[Upper])" in both measures seem redundant but it is required so that each bar does not show All spend in every bucket.
Similar logic is applied for the cumulative%, which basically adds all spend with lower rank. For completeness, I've included below.
This is then applied in the Line values in the chart, with DimRank.Buckets as the Shared Axis.
1st measure:
2nd measure:
Happy Daxing!
@PerAsperaAdAstr , Value selectedID need to used
Ranking =
var selectedID=VALUES(DimCustomer[Id])
var aTable =
ADDCOLUMNS(
SUMMARIZE(DimCustomer,DimCustomer[Id]),"rank 2",[Rank],"measure 3",[Measure 3])
return
CALCULATE(SUMX(values(selectedID),[rank 2]),FILTER(aTable,[rank 2]>=VALUES(DimRank[Lower])&&[rank 2]<=VALUES(DimRank[Upper])))
see if the above can work. moved that to sumx
also, refer
https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization
https://radacad.com/dynamic-banding-or-grouping-in-power-bi-using-dax-measures-choose-the-size-of-bi...
https://www.credera.com/blog/technology-solutions/creating-aging-report-using-a-user-selected-date-i...
new dax didnt work
@PerAsperaAdAstr , Try like
Ranking =
CALCULATE(SUMX(VALUES(DimCustomer[Id]),[rank]),FILTER(aTable,[Rank]>=Min(DimRank[Lower])&&[rank ]<=Max(DimRank[Upper])))
I've got it working now. I had a filter on (Measure 3 not blank) and that hid some of the data.
So this measure works!
So to summarize the solution for anyone who may need it in the future.
The aim was to generate the following Pareto Graph.
Customers are ranked based on their spend (dynamic filters applied). Then grouped into 1-100 bins based on their rank.
Each bar represent the total spend per group.
So having created rank, based on the individuals spend. Then I needed 2 measures.
1. I created the following measure, to group the total sales by rank bin. I've included a screenshot of the DimRank table I created. It is an unconnected table.
(For some reason the measure didn't work when I tried to simplify my dax any further/using variables so there is some repetition)
DimRank table looks like:
Then I created the second measure, using the previous measure I created:
This measure is then used in the line/bar chart in column values.
Please note, it may look like "rankingid>=VALUES(DimRank[Lower])&&rankingid<=VALUES(DimRank[Upper])" in both measures seem redundant but it is required so that each bar does not show All spend in every bucket.
Similar logic is applied for the cumulative%, which basically adds all spend with lower rank. For completeness, I've included below.
This is then applied in the Line values in the chart, with DimRank.Buckets as the Shared Axis.
1st measure:
2nd measure:
Happy Daxing!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |