Forum Discussion

dlkrdrf's avatar
dlkrdrf
New Member
4 months ago
Solved

Total measures show wrong total when report is published

Hi everyone,

we've have a semantic model with a lot of measures, mostly SUMX(), sometimes with filter, such as, IF ("1" IN VALUES(Table[Column]), SUMX(Table[Column])). All reports are build based on the semantic model and published into an app. The figures are fine on the desktop as well as in the published app. Not long ago, all the total measures show wrong numbers in the reports, on the desktop as well as in the app. Same measures are working fine in the semantic model on the desktop. But once published they do not work anymore.

Has anyone encountered the same issue? It's strange that everything was fine until a few weeks ago. Something seems to happen when publishing.

I'd appreciate any idea.

Cheers!

  • Hi dlkrdrf,

     

    This is a common issue while working with SUMX() function, while it works perfect in few cases but it can change the row context while adding it to a matrix or table visuals, you can use inscope() function to cater this.

     

    Measure =
    IF(
    ISINSCOPE(Table[Column]),
    [Row Logic],
    SUMX(
    VALUES(Table[Column]),
    [Row Logic]
    )
    )

     

    ๐ŸŒŸ 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!

6 Replies

  • Hi dlkrdrf  - In most cases, totals start showing incorrect results because measures using SUMX, IF, and VALUES() behave differently at total level due to filter context.

    suggest you to check at :

    if this issue is at only at totals or row level too?

    Any recent changes in relationships or data refresh

    or any measures using selectedvalues or if/values >

     

    Please check and share more details that helps us to understand more about.

     

     

    • dlkrdrf's avatar
      dlkrdrf
      New Member

      Hi rajendraongole1 ,

       

      thanks. The issue is only at total. No changes in relationships or data refresh. The measure with issue is

       

      Measure T1 =
          IF (
              "1" IN VALUES (
                  'Tbl1'[Period]),
                  CALCULATE (
                      SUM (
                          'Tbl2'[Column1])))
      There are several measures like this one. In Power BI desktop I have a table with them. The total works perfectly fine. But once published, the web version shows wrong total.

       

      Any idea why the total behaves differently in desktop and in web?

       

      Cheers!

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

        Hi dlkrdrf - suggest you the stable approach should be when you are writing the measure for toal.

         

        Measure T1 =
        VAR _Period =
        SELECTEDVALUE('Tbl1'[Period])

        RETURN
        IF(
        _Period = "1",
        CALCULATE(
        SUM('Tbl2'[Column1])
        )
        )

         However, if totals must aggregate correctly, even SELECTEDVALUE() can return BLANK at totals. Hope this helps. 

  • Hi dlkrdrf,

     

    This is a common issue while working with SUMX() function, while it works perfect in few cases but it can change the row context while adding it to a matrix or table visuals, you can use inscope() function to cater this.

     

    Measure =
    IF(
    ISINSCOPE(Table[Column]),
    [Row Logic],
    SUMX(
    VALUES(Table[Column]),
    [Row Logic]
    )
    )

     

    ๐ŸŒŸ 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!

    • dlkrdrf's avatar
      dlkrdrf
      New Member

      Hi grazitti_sapna ,

      thanks. I'll try to add this function to the measures. We usually use many filters placed in the filters panel or as slicers on the reports. Do I need to include all these filters in the measures? Like to use multiple ISINSCOPE()?

      Cheers!

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

        Hi dlkrdrf,

         

        No only the columns (Dimesions) which are being usen in the table or matrix view. Slicers/filters would work normally as you slice/filter the data. this is just to provide the actual row context to you measure for that paticular visual.

         

        also there is an recent update (Mar'26) where you can choos how the total should be displayed. try that if that fixes your issue. take a look here