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 everybody,
I am creating a report for which I use and index slicer. I want to compare a value from the current selection with the value previous to the current selection.
Index | ProjectID | Value | Text |
1 | P1 | 100 | XYZ1 |
1 | P2 | 200 | XYZ2 |
1 | P3 | 250 | XYZ3 |
2 | P1 | 150 | XYZ4 |
2 | P2 | 250 | XYZ5 |
2 | P3 | 300 | XYZ6 |
3 | P1 | 200 | XYZ7 |
3 | P2 | 300 | XYZ8 |
3 | P3 | 350 | XYZ9 |
So if i select index "3" in my slicer i'd like to see the following for P1 and P2:
Project | Prev. Value | curr. value | curr text |
P1 | 150 | 200 | XYZ7 |
P2 | 250 | 300 | XYZ8 |
And if I select index "2" i'd like to see:
Project | Prev. Value | curr. value | curr text |
P1 | 100 | 150 | XYZ4 |
P2 | 200 | 250 | XYZ5 |
I found a lot of relative date functions that look similar, but are not sufficient for this solution. Also i need a solution for numeric values and Text values.
Is there anybody that can help me out?
Thanks!
Now i have an additional question of which I hoped would have been solved by your solution, but it isn't.
CALCULATE ( SUM ( Data[Value] ), Data[Index] = MAX ( Data[Index] ) - 1 )
There is an additional filter that I want to include to this formula. I want to add another filter in this formula in which i select for a specific value in another table.
Previous score =
CALCULATE(
SUM( 'subject_score'[Score]),
Index[index] = MAX(Index[index) - 1),
FILTER('subject_score', 'subject_score'[subject] = "Money"))
With this addition the value does not show in my table. Am i doing something wrong while using a double filter?
new data example:
Thanks already!
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
Prev value: =
CALCULATE ( SUM ( Data[Value] ), Data[Index] = MAX ( Data[Index] ) - 1 )
Current value: =
SUM( Data[Value] )
Current text: =
SELECTEDVALUE( Data[Text] )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
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 |
---|---|
43 | |
23 | |
21 | |
15 | |
15 |
User | Count |
---|---|
46 | |
31 | |
30 | |
18 | |
18 |