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.
I have a problem with the creation of a measure that determines the position of company A in relation to other companies at a price.
https://drive.google.com/file/d/1P9Dtuv4m4boBElNUqFCqenWOPM1h3liK/view?usp=sharing <-- pbx
Solved! Go to Solution.
Give this a shot
Measure = COUNTROWS ( FILTER ( VALUES ( Data[company] ), [lowest price company A] > CALCULATE ( MIN ( Data[cost_per_day] ) ) ) ) + 1
HI @krzysztof ,
You can try to use following formula to calculate rank:
rank = VAR summary = SUMMARIZE ( FILTER ( ALL ( Data ), [company] = "A" ), [company], [car_class], [car_gearbox], [localization], [days], "minPrice", MIN ( Data[cost_per_day] ) ) VAR currPrice = CALCULATE ( MIN ( Data[cost_per_day] ), FILTER ( ALLSELECTED ( Data ), [company] = "A" && Data[car_class] = EARLIER ( Data[car_class] ) && Data[car_gearbox] = EARLIER ( Data[car_gearbox] ) && Data[localization] = EARLIER ( Data[localization] ) && Data[days] = EARLIER ( Data[days] ) ) ) RETURN IF ( [company] = "A", COUNTROWS ( FILTER(summary,[minPrice]>currPrice ) )+1)
Regards,
Xiaoxin Sheng
Thank you @v-shex-msft for your response. Unfortunately, your calculation is not working properly, it shows very large numbers. In the picture, I described more precisely what I am asking for
Also we can use RANKX function
Measure 2 = RANKX ( VALUES ( Data[company] ), CALCULATE ( MIN ( Data[cost_per_day] ) ), [lowest price company A], ASC, DENSE )
Give this a shot
Measure = COUNTROWS ( FILTER ( VALUES ( Data[company] ), [lowest price company A] > CALCULATE ( MIN ( Data[cost_per_day] ) ) ) ) + 1
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 |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |