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.
Hello,
I am trying to calculate WTD, MTD, STD, YTD Sales using the following code:
WTD Sales = if(LOOKUPVALUE(Dim_Day[Week Number],Dim_Day[Day],Sales[Week End Date])=lookupvalue(Dim_Day[Week Number],Dim_Day[day],today())-1,Sales[Total Sales],0)
I have sales data for the past 3 years. My years start and stop based on a customer calendar. Sales are only recorded only a weekly basis (Saturdays).
Data is recorded one week behind so that is why I indicated -1 after today(). This code was working fine a few days ago for WTD from last week but now it's not working at all. Not sure what happened.
In addition, I want users to be able to navigate between weeks. That is, be able to see what WTD sales were depending on the week they choose.
Can someone help with this? Let me know if you require more info in order to help.
Thank you in advance.
Solved! Go to Solution.
Hi @mv2019
Please check if below measure could help.If it is not your case,please share some sample data and expected output which would be helpful to provide an accurate solution.You can also upload the .pbix file to OneDrive and post the link here. Do mask sensitive data before uploading.
Reference post:https://community.powerbi.com/t5/Desktop/Relative-WTD-MTD-amp-YTD-values/td-p/209139
How to Get Your Question Answered Quickly
WTD := CALCULATE ( SUM ( Table1[Sales] ), DATESINPERIOD ( Table1[Date], LASTDATE ( Table1[Date] ), - WEEKDAY ( LASTDATE ( Table1[Date] ) ), DAY ) )
Regards,
Hi @mv2019
Please check if below measure could help.If it is not your case,please share some sample data and expected output which would be helpful to provide an accurate solution.You can also upload the .pbix file to OneDrive and post the link here. Do mask sensitive data before uploading.
Reference post:https://community.powerbi.com/t5/Desktop/Relative-WTD-MTD-amp-YTD-values/td-p/209139
How to Get Your Question Answered Quickly
WTD := CALCULATE ( SUM ( Table1[Sales] ), DATESINPERIOD ( Table1[Date], LASTDATE ( Table1[Date] ), - WEEKDAY ( LASTDATE ( Table1[Date] ) ), DAY ) )
Regards,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
107 | |
79 | |
71 | |
66 |
User | Count |
---|---|
141 | |
107 | |
100 | |
82 | |
74 |