Forum Discussion

14 Replies

  • Hi arjun0028,

     

    when Month is sorted using another column (like Financial Month Index) but the MoM DAX calculation uses the visible month column instead of the true date context. As a result, Power BI cannot correctly detect the previous month, so the calculation returns 0%.

     

    You should include date column in your Growth % column, Refer below example DAX

     

    MoM Growth % =
    VAR CurrentValue =
    [Course Enrollments]

    VAR PreviousMonth =
    CALCULATE(
    [Course Enrollments],
    DATEADD('Date'[Date], -1, MONTH)
    )

    RETURN
    DIVIDE(CurrentValue - PreviousMonth, PreviousMonth)

     

    🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
    🔗 Curious to explore more? [Discover here].
    Let’s keep building smarter solutions together!

  • Step 1) Use a proper calendar table

    Mark it as Date Table in the model.

     

    Step 2) Use the Date column in the time calculation

    Example MoM growth measure:

    MoM Growth % =
    VAR CurrentValue =
        SUM ( 'FactTable'[Value] )
    VAR PreviousValue =
        CALCULATE (
            SUM ( 'FactTable'[Value] ),
            DATEADD ( 'Calendar'[Date], -1, MONTH )
        )
    RETURN
    DIVIDE ( CurrentValue - PreviousValue, PreviousValue )

     

    Step 3) Use Month label only for display

    In the matrix you can use something like:

    • Rows → Branch
    • Columns → Calendar[Fiscal Month Name]
    • Sort that column by → Calendar[Fiscal Month Number]

     

    Step 4) Check the relationship

    Ensure that "Calendar[Date] → FactTable[Date]" is the active relationship.

    • arjun0028's avatar
      arjun0028
      Regular Visitor

      Adjust this code

      % Growth Enrolment MOM =
      IF(
          ISFILTERED('Booking Live Data'[BC_Date]),
          ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
          VAR __PREV_MONTH =
              CALCULATE(
                  SUM('Booking Live Data'[Enrol_Count]),
                  DATEADD('Booking Live Data'[BC_Date].[Date], -1, MONTH)
              )
          RETURN
              DIVIDE(SUM('Booking Live Data'[Enrol_Count]) - __PREV_MONTH, __PREV_MONTH)
      )
      • arjun0028's avatar
        arjun0028
        Regular Visitor

        The other measures get affected despite using this method this method is not the effective method

         

    • arjun0028's avatar
      arjun0028
      Regular Visitor

      Hi I followed this method not getting percentage as 0 but a constant 0.01 percentage please help me out

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi arjun0028,

     

    Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to grazitti_sapna and cengizhanarslan  for prompt and helpful responses.

     

    The issue usually happens when the time intelligence calculation is using the date column from the fact table instead of a proper calendar table, especially when the visual is grouped by a sorted month field. Functions like DATEADD work correctly only with a continuous date column from a dedicated Date/Calendar table. I would recommend creating or using a Calendar table, marking it as a Date table, and creating an active relationship between Calendar[Date] and 'Booking Live Data'[BC_Date]. Then update the MoM calculation to use Calendar[Date] inside DATEADD and use the month name from the Calendar table in the matrix. This usually resolves issues where the MoM growth shows 0 or constant values.

     

    Thanks & Regards,

    Prasanna Kumar

    • arjun0028's avatar
      arjun0028
      Regular Visitor

      Is there any other alternative method because the calendar method has not worked out properly despite trying it out

      • grazitti_sapna's avatar
        grazitti_sapna
        Icon for Super User rankSuper User

        Hi arjun0028,

         

        I've already shared an .pbix file working example, you can add those columns to your existing table and try using it

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi arjun0028,

    Have you tried the suggestion provided by grazitti_sapna? Alternatively, you may also try calculating the previous month using a Year–Month column (e.g., YYYYMM) instead of relying on time intelligence functions like DATEADD, especially if the calendar table approach did not work as expected.

     

    Thanks & Regards,

    Prasanna Kumar

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi arjun0028,

     

    If the issue still persists, we kindly request you to share the sample data in a workable format such as text, an Excel file, or a PBIX file with sample data instead of screenshots. Additionally, please include the expected output. This will enable us to assist you more effectively.


    Regards,
    Prasanna Kumar