Forum Discussion
Create Measure or Calculated Table from Daily values to get Monthly values
- 4 years ago
Hi lkshck ,
You need to create a calendar dimension table then relate calendar[date] (1) to fact[date] (many).
In your calendar table, add a month field that can be used in visuals.
You can do this in Power Query something like this:
Date.MonthName([date])Or in DAX like this:
monthName = FORMAT( calendar[date], "MMMM" )Power BI will automatically aggregate your daily values to monthly values when implemented like this.
This can be extended for years, financial years, quarters etc.
Once you have the calendar table set up correctly (and marked as a date table), you can then use Power BI's time intelligence functions for your calculations. Things like Month to Date, Year to Date etc. are all in-built DAX functions that become available.
Pete
Hi, lkshck ;
You could create a measure as follows:
sum = CALCULATE(SUM([number_of_requests]),FILTER(ALLSELECTED('Table'),EOMONTH([date],0)=EOMONTH(MAX([date]),0)))
The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.