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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
MG4
Regular Visitor

calculated field on same table and field

Hi all,

 

On "X" table I have two (relevant) fields: "weeks" and "volume".

I want to display 3 columns: the volume on current week , the volume on the previous week and the difference between these two weeks (Delta).

I have tried to do so but I don't know how to calculate the delta between two columns that actually belong to the same field.

 

Thanks in advanced!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@MG4,


Create the following columns in your table. If the DAX don't help, please share dummy data of your table and post expected result.

pre = CALCULATE(FIRSTNONBLANK(X[Volume],1),FILTER(X,X[Weeks]=EARLIER(X[Weeks])-1))
delta = IF(ISBLANK(X[pre]),BLANK(), X[Volume]-X[pre])

1.PNG

Regards,
Lydia

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@MG4,


Create the following columns in your table. If the DAX don't help, please share dummy data of your table and post expected result.

pre = CALCULATE(FIRSTNONBLANK(X[Volume],1),FILTER(X,X[Weeks]=EARLIER(X[Weeks])-1))
delta = IF(ISBLANK(X[pre]),BLANK(), X[Volume]-X[pre])

1.PNG

Regards,
Lydia

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors