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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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