Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
this is how it should appear.
Solved! Go to Solution.
Hi
Looks working fine.
Lastdate( valuedate-1) is not working, so i just hardcoded that data for testing.
Thanks
Raj
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
Can you please post some sample data and expected output?
hello thank you for the reply, I have updated my post.
Hi
Looks working fine.
Lastdate( valuedate-1) is not working, so i just hardcoded that data for testing.
Thanks
Raj
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
124 | |
76 | |
71 | |
57 | |
50 |
User | Count |
---|---|
162 | |
84 | |
68 | |
66 | |
61 |