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
Anonymous
Not applicable

Help with current formula

Hello power bi community, I created this measure to subtract 2 days worth of information, my measure has been working but recently since there have been some days where information is not recorded the measure does not seem to do what its supposed to. For example if on the 1st something is recorded but on the 2nd nothing is recorded the measure does not work. How can i get the measure to subtract no matter what.

This is my measure;

 

VAR __YESTERDAY =
CALCULATE(
SUM('TABLE'[Amount ]),
LASTDATE('TABLE'[Value Date]))
VAR __DAYB4YEST =
CALCULATE(
SUM('TABLE'[Amount ]),
LASTDATE('TABLE'[Value Date]-1))
RETURN
(__YESTERDAY - __DAYB4YEST)

 

For example; 

the variance is the desired output. Unfortunately since its a transaction on days where there is no movement on an account my formula does not subtract it looks like this.the variance is the desired output. Unfortunately since its a transaction on days where there is no movement on an account my formula does not subtract it looks like this.this is how it should appear.this is how it should appear.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi

Looks working fine.

 

Last date.PNG

 

Lastdate( valuedate-1) is not working, so i just hardcoded that data for testing.

 

Thanks

Raj

View solution in original post

4 REPLIES 4
v-danhe-msft
Employee
Employee

Hi @Anonymous,

Can you provide sample data? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Can you please post some sample data and expected output?

Anonymous
Not applicable

hello thank you for the reply, I have updated my post. 

Anonymous
Not applicable

Hi

Looks working fine.

 

Last date.PNG

 

Lastdate( valuedate-1) is not working, so i just hardcoded that data for testing.

 

Thanks

Raj

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.