Forum Discussion
Anonymous
2 years agoNot applicable
Remove row value from total calculation
Hi Team, I have a table in Power BI visual with the rows and totals. Now while calculating totals, I need to remove one row value but include the others. For now the total in excel is sum of ...
Anonymous
2 years agoNot applicable
Hi Anonymous
Please try this:
Here I create a set of sample:
Table:
Open the power query and add a Index Column in the Add Column pane:
Apply and Close.
Then add a measure:
SumValue =
IF (
HASONEVALUE ( 'Table'[ID] ), //Determine whether it is a Totar line
SUM ( 'Table'[Values] ), //Returns a value for a non-Total line
SUMX (
FILTER ( 'Table', 'Table'[Index] >= 2 && 'Table'[Index] <= 8 ),
'Table'[Values]
) //The sum of lines 2-8 is returned in the total line
)
The result is as follow:
HASONEVALUE function (DAX) - DAX | Microsoft Learn
FILTER function (DAX) - DAX | Microsoft Learn
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.