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,
could some one help me to calculate the following using DAX
Earned Point | Reedeem Point | Point Balance |
2 | 0 | 0 |
3 | 0 | 0 |
5 | 2 | 8 |
7 | 0 | 15 |
2 | 4 | 13 |
thanks
Solved! Go to Solution.
Hi @abc_777
Here is a sample file with the solutuion https://www.dropbox.com/t/cvHrJVgWHiu6ZPaf
First you need to add index column (if you have unique date or date/time column it also works just fine)
Then use the following code to create a new calculated column (let me know if you need measure instead)
Point Balance =
VAR CurrentIndex = Data[Index]
VAR TableOnAndBefore = FILTER ( Data, Data[Index] <= CurrentIndex )
VAR EarnedPoints = SUMX ( TableOnAndBefore, Data[Earned Point] )
VAR RedeemedPoints = SUMX ( TableOnAndBefore, Data[Reedeem Point] )
RETURN
IF (
RedeemedPoints = 0,
0,
EarnedPoints - RedeemedPoints
)
Hi @abc_777
Here is a sample file with the solutuion https://www.dropbox.com/t/cvHrJVgWHiu6ZPaf
First you need to add index column (if you have unique date or date/time column it also works just fine)
Then use the following code to create a new calculated column (let me know if you need measure instead)
Point Balance =
VAR CurrentIndex = Data[Index]
VAR TableOnAndBefore = FILTER ( Data, Data[Index] <= CurrentIndex )
VAR EarnedPoints = SUMX ( TableOnAndBefore, Data[Earned Point] )
VAR RedeemedPoints = SUMX ( TableOnAndBefore, Data[Reedeem Point] )
RETURN
IF (
RedeemedPoints = 0,
0,
EarnedPoints - RedeemedPoints
)
greate thanks
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 | |
97 | |
75 | |
65 | |
53 |
User | Count |
---|---|
144 | |
103 | |
98 | |
85 | |
64 |