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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.