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

How to Include two dates in a measure for a calculation

Dear All

 

I hope you are doing well. While doing some hands-on, I got a scenario where I have to show Month-wise Pending Purchase Orders Qty. (EKET.MENGE) of different products in a report column. This Qty is based on estimated Delivery Date (EKET.EINDT) but it should incorporate (subtract) the Actual Received Qty (MSEG.MENGE) based on Actual Receiving Date (MSEG.BUDAT). I have shared the measure I am using right now but it doesn't include any logic for Actual Receiving Qty & Date. I wanted to ask you how I can add that logic into this measure so it can reflect pending orders Qty after subtracting actually received Qty. Note that this measure already includes logic as month select is dynamic based on the Date filter (date chosen by users in filter)

 

VAR SELECTEDDATE = MAX(DateMaster[Date])

VAR NEXTDATE = DATESINPERIOD('DateMaster-temp'[Date],SELECTEDDATE+1,+1,MONTH)

 

VAR RESULT =    

              CALCULATE(TOTALMTD(CALCULATE(SUM(EKPO[EKET.MENGE]),EKKO[LIFNR]="1000000588"),DateMaster[Date]),              REMOVEFILTERS(DateMaster),    

             KEEPFILTERS(NEXTDATE),    

             USERELATIONSHIP('DateMaster-temp'[Date],DateMaster[Date]))

return result

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @Anonymous ,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.