Forum Discussion
Calculate new data
I need to calculate new data with PowerQuery Editor
Starting from a data (ex: 05.05.2023) I need to calculare the same data but the following month (05.06.2023)
2 Replies
- lbendlinSuper User
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - Ashish_MathurSuper User
Hi,
Try this method/pattern
- Create a Calendar Table
- Crate a relationship (Many to One and Single) from the Date column of your Data Table to the Date column of the Calendar Table
- Create a slicer from the Date column of the Calendar Table and select a Date
- Write these measures
Total = sum(Data[Sales])
Total in prevous month = calculate([Total],datesbetween(calendar[date],edate(min(calendar[date]),-1),edate(min(calendar[date]),-1)))
Hope this helps.