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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
LFM
Helper III
Helper III

Calculate value for previous day in matrix

I have a matrix that shows expected exposure for years in the future. On the rows is reportdate and on the columns is the year expectation and values is exposure. Those are in the same table. I want to calculate exposure for the previous day to see how much it have changed from one date to next. How can I do that? I will incude thos values in the matrix. Can I do that with measure or do I have to make a new column? 

Skjermbilde 2024-04-10 154925.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @LFM ,

Based on your problems, I create a table as you mentioned.

vyilongmsft_0-1713247613860.png

Then I put the table into the Matrix.

vyilongmsft_1-1713247692499.png

Next I create a measure and here is the DAX code.

Measure = 
SUM ( 'Table'[Exposure] )
    - CALCULATE ( SUM ( 'Table'[Exposure] ), PREVIOUSDAY ( 'Table'[Reportdate] ) )

vyilongmsft_2-1713247933999.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @LFM ,

Based on your problems, I create a table as you mentioned.

vyilongmsft_0-1713247613860.png

Then I put the table into the Matrix.

vyilongmsft_1-1713247692499.png

Next I create a measure and here is the DAX code.

Measure = 
SUM ( 'Table'[Exposure] )
    - CALCULATE ( SUM ( 'Table'[Exposure] ), PREVIOUSDAY ( 'Table'[Reportdate] ) )

vyilongmsft_2-1713247933999.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

littlemojopuppy
Community Champion
Community Champion

@LFM try the PREVIOUSDAY() function

 

If you're looking for last date with data, try LASTNONBLANK().

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors