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.
Hello,
I have a measure I created that is named [Cost to Date], & then I have cost codes aligning with those cost's. Example data is below:
Cost Code Cost to Date
01-200 $1,000,000
01-201 $48,000
01-203 $1,200,000
01-204 ($100,088)
01-205 ($10,000)
Now if I want to just show the smallest two values from the cost codes, is there a way to use the ranking system to make this possible?
All help will be very much appreciated.
Solved! Go to Solution.
@PeteSil , You can use TOPN and Window
CALCULATE( Sum(Table[Cost to Date]),
TOPN( 2, ALL(Table[Cost Code]), CALCULATE( Sum(Table[Cost to Date])), ASC),
VALUES( Table[Cost Code] ))
Learn Power BI: Dynamic TOPN using TOPN/Window and Numeric parameter: https://youtu.be/vm2mdEioQPQ
Hey,
You can achieve this task by DAX query using TOPN function.
CALCULATE( Sum(Table[Cost to Date]),
TOPN( 2, ALL(Table[Cost_Code]), CALCULATE( Sum(Table[Cost to Date])), ASC),
VALUES( Table[Cost_Code] ))
I hope this will help.
@PeteSil , You can use TOPN and Window
CALCULATE( Sum(Table[Cost to Date]),
TOPN( 2, ALL(Table[Cost Code]), CALCULATE( Sum(Table[Cost to Date])), ASC),
VALUES( Table[Cost Code] ))
Learn Power BI: Dynamic TOPN using TOPN/Window and Numeric parameter: https://youtu.be/vm2mdEioQPQ
This worked. Thank you very much!
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 |
---|---|
107 | |
98 | |
78 | |
65 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |