Forum Discussion

Aahil10's avatar
Aahil10
Frequent Visitor
5 years ago
Solved

Custom Time Intelligence Function

Hello, I've managed to use the TotalMTD function to calulate variance on a monthly level - However we use production month which tends to be different for celandar month. So for example, whilst May ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Aahil10 

    In your screenshot, you build custom columns in Power Query Editor(M query). I build calculated column in Report view (Dax). Try to use my dax code to build calculated column.

    For reference: Create calculated columns in Power BI Desktop

    If you want to calcualte MTD for each "Month", you can build a Fiscal Month column.

    Fiscal Month = RANKX(FILTER('Calendar','Calendar'[Year] = EARLIER('Calendar'[Year])),'Calendar'[Month Start Date],,ASC,Dense)

    Ex: Jan Prod Month is Jan 1- Jan 30 is Month 1, 

    May 1 - June 5 is Month 5.

    Then you can calculate MTD by Fiscal Month for each Fiscal Month.

     

    Best Regards,

    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.