Forum Discussion

lkshck's avatar
lkshck
Helper III
4 years ago
Solved

Create Measure or Calculated Table from Daily values to get Monthly values

Hi,   I'm currently having a table which looks like the following: date number_of_requests 01.01.2020 300 02.01.2020 125 03.01.2020 279 04.01.2020 432 So everything is base...
  • BA_Pete's avatar
    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