Forum Discussion
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
- rajendraongole1
Super User
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.
- dlkrdrfNew 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
Super 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.
- grazitti_sapna
Super User
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!- dlkrdrfNew 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
Super 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