Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello everyone,
My concern-
I have three measures Measure 1, Measure 2, Measure 3 belonging to Table 1, Table 2, Table 3 respectively.
My final measure (FinalMeasure) is basically the sum of the above three measures.
Suppose the measure represents Quantity and has corresponding items.
I want to find top 10 Items with maximum value for FinalMeasure.
I tried doing this using RANKX function but the ranks are not as expected.
Any help is greatly appreciated.
Thanks in advance.
Suguna.
Solved! Go to Solution.
Hi Suguna,
I just copied your data and formula. It works fine. Please refer to the snapshots and the demo in the attachment. One tip: the [ItemID] in the visual should be from the ItemMaster table.
Best Regards,
Dale
Hi @bidevsugmen,
Could you please mark the proper answers as solutions?
Best Regards,
Dale
Hi Suguna,
The measure could invoke some Tables. But a measure doesn't belong to any table. In other words, you can put it anywhere in the model.
Can you share a little sample of your data?
In your scenario, there should be a dimension table that has all the items and has relationships with the other three tables. The final visual should be the items from the dimension table and the FinalMeasure.
Best Regards,
Dale
Hi Dale,
Kindly refer the screenshots below for sample data.
There is one to many relationship between Item master and each of the other tables shown above.
My final measure is CALCULATE(SUM(Table1[OnHand Qty])) + CALCULATE(SUM(Table2[Ordered Qty])) - CALCULATE(SUM(Table3[OnOrder Qty]))
Now, i need to get top 10 items with maximum value for final measure. So i used
Rank = IF(HASONEVALUE(IItemMaster[ItemName]);RANKX(ALLSELECTED(ItemMaster);[Final Measure];;DESC))
IncludeTop10 = IF([Rank] <= 10; 1; 0)
Lastly, apply visual level filter on IncludeTop10 = 1.
However, this does not give the ranking as expected, in turn does not get the correct top 10 items.
Thanks,
Suguna.
Hi Suguna,
I just copied your data and formula. It works fine. Please refer to the snapshots and the demo in the attachment. One tip: the [ItemID] in the visual should be from the ItemMaster table.
Best Regards,
Dale
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 |
---|---|
109 | |
102 | |
84 | |
79 | |
68 |
User | Count |
---|---|
120 | |
110 | |
94 | |
81 | |
77 |