Forum Discussion

srinivas_fabric's avatar
srinivas_fabric
Regular Visitor
1 year ago
Solved

Getting original data after drillup

I have a matrix visual with rows category, Subscription.Colums Custom and Column1. In values Section I have field Q1 Per2%.I have hierarchy With Custom and Column1. I have used this hierarchy in co...
  • DataNinja777's avatar
    1 year ago

    Hi srinivas_fabric ,

     

    When drilling up in a Power BI matrix visual, it’s common to lose the aggregated values you saw at the more granular level—like Jan, Feb, Mar disappearing and leaving Q1 blank. This happens because the measure you’re using is probably evaluated at the visible level of the hierarchy, and once you drill up, the month-level context is gone. If your DAX measure was depending on that, it simply returns nothing. Hardcoding specific months like “Jan”, “Feb”, and “Mar” inside the measure might seem like a fix at first, but it’s not scalable, especially if you want to apply the same logic to Q2, Q3, or future years.

    The best practice here is to rely on your Calendar table, which should already have columns for Date, Month, Quarter, and Year. Assuming your Calendar table is related to your fact table through the date field, you can write a measure like this:

    Q_Per2% =
    VAR SelectedQuarter = SELECTEDVALUE('Calendar'[Quarter])
    RETURN
    DIVIDE(
        CALCULATE(
            SUM('Data'[Value]),
            'Calendar'[Quarter] = SelectedQuarter
        ),
        CALCULATE(
            SUM('Data'[Target]),
            'Calendar'[Quarter] = SelectedQuarter
        )
    )
    

    This way, the calculation works at any level—whether you're drilled into months or rolled up to quarters—because it's always looking at the Calendar context dynamically. It doesn't rely on hardcoding, and it automatically adapts when the user drills up or down in the hierarchy. The key is ensuring the calendar table is properly related and has the granularity needed to support flexible, context-aware calculations like this.

     

    Best regards,

  • v-tejrama's avatar
    1 year ago

    Hi srinivas_fabric

    To resolve the issue where aggregated values disappeared after drilling up in a Power BI matrix visual, we set up proper time intelligence. We created a Calendar table using DAX, including columns like Date, MonthName, MonthNumber, Quarter, and Year.

    This table was linked to the fact table through the Date column to maintain accurate time relationships. To ensure months display in the correct order, we sorted the MonthName column by MonthNumber.

    Then, we created a dynamic DAX measure that calculates totals based on the selected Quarter and Year, avoiding hardcoded values like “Q1.”

    This measure was added to the matrix visual, with Quarter and MonthName used in the row hierarchy, and drill functionality enabled. As a result, the matrix now shows month-level breakdowns correctly and displays accurate totals when drilling up to the quarter level.

     

    If this helps, kindly click "Accept as Solution" and give a "Kudos" so others can benefit. Let me know if you need further assistance!

     

    Thank you,
    Tejaswi.