Forum Discussion

Swiya's avatar
Swiya
Frequent Visitor
1 year ago
Solved

Totals in Matrix visual showing wrong total

I have a measure that calculates the cost of each employee per month by dividing the total cost by the number of month they are available for this year.

Following is the measure:

var capacity = CALCULATE(SUM('SAI Med Capacity Analysis 2025'[2025 RealCapacity ]),ALL('Month Table with weeks'))/CALCULATE(COUNT('SAI Med Capacity 2025 monthly'[Value]),ALL('Month Table with weeks'))

var result =
SUMX(
    CALCULATETABLE(VALUES('SAI Med Capacity 2025 monthly'[Name ]),ALL('Month Table with weeks')),
    CALCULATE(
    sumx(
           FILTER(
                'Month Table with weeks',
                MAX('SAI Med Capacity 2025 monthly'[Value]) = "X"),
                 
            capacity
    )
    )
)
   

return result
However, the measure is not giving the correct column total in a matrix visual. Here is the screenshot for the same:

Any help would be appreciate. Thanks is advance

  • Swiya's avatar
    Swiya
    1 year ago

    Hi v-achippa

    This is resolved but I didnt get much help on the same topic

    What I discovered was that the sumx doesnt work in the same measure where you calculate the it. I created another measure and calculated sumx there and the totals came out to be correct.

    Let me know if i mark this as resolved

6 Replies

  • Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
    Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
    Please show the expected outcome based on the sample data you provided.

    Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

  • v-achippa's avatar
    v-achippa
    Community Support

    Hi Swiya,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Thank you lbendlin for the prompt response.

     

    As we haven’t heard back from you, we wanted to kindly follow up to check if the issue is resolved? If not please provide some sample data that covers your issue so that we can look more into it and provide you the best solution possible. Let us know if you need any further assistance.

     

    Thanks and regards,

    Anjan Kumar Chippa

    • v-achippa's avatar
      v-achippa
      Community Support

      Hi @Swiya,

       

      We wanted to kindly follow up to check if the issue is resolved? or let us know if you need any further assistance.

       

      Thanks and regards,

      Anjan Kumar Chippa

      • Swiya's avatar
        Swiya
        Frequent Visitor

        Hi v-achippa

        This is resolved but I didnt get much help on the same topic

        What I discovered was that the sumx doesnt work in the same measure where you calculate the it. I created another measure and calculated sumx there and the totals came out to be correct.

        Let me know if i mark this as resolved