Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
abc_777
Post Prodigy
Post Prodigy

hi

Hi,

could some one help me to calculate the following using DAX

 

Earned PointReedeem PointPoint Balance
200
300
528
7015
2413

 

thanks

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

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)

1.png

Then use the following code to create a new calculated column (let me know if you need measure instead)

2.png

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
    )

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

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)

1.png

Then use the following code to create a new calculated column (let me know if you need measure instead)

2.png

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

ribisht17
Super User
Super User

@abc_777 

 

Question is not clear

 

Regards,

Ritesh

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.