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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Tricky Subtraction based on PDate values

Hi Experts

 

Need a DAX Measure based on Pdate (purchase date) to subtract the corresponding DDate value - as shown below i have two Pdate values over two weeks. Week Starting monday 21/09/2020 and week starting 28/09/2020. for those Pdate i have certain Ddate value - as shown below i want to be able to subtract the Orange values from the Blue vales for the correponding Ddate 

 

Note if in the case you have no corresponding DDate based on Pdate as shown RED then zero

 

Both PDate and Ddate are in the same table - happy if a calculated column meaure works best 

 

See image Below. 

 

BlueWhite111_0-1681130488864.png

 

Sample Date in excel
https://www.dropbox.com/scl/fi/xhkbti01s3r7xqz4csk5g/Book1.xlsx?dl=0&rlkey=ic2tviq3cgfm1ir72220e1ac4 

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

A small question, why did 2671 minus 2929 on September 21, but the next line starts with 3695 minus 3972 on September 28? I hope you can understand my doubts, I mean the blue area and the orange area, on what logic do you distinguish again?

13.png

 

Best Regards,

Stephen Tao

 

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

Anonymous
Not applicable

HI Stephen t- typo on my part red box date 21.09.20 should be 28.09.20

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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