Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply

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 row 2-row8 and it exclude the value in row 9. I need the same thing in PBI. I need the datat to show for that project but in totals, it should not calculate that amount.

mohiniverma2704_1-1726463729244.png

 

 

2 REPLIES 2
Anonymous
Not applicable

Hi @mohiniverma2704 

 

Please try this:

Here I create a set of sample:

Table:

vzhengdxumsft_2-1728367192435.png

Open the power query and add a Index Column in the Add Column pane:

vzhengdxumsft_1-1728367149548.png

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:

vzhengdxumsft_3-1728367420845.png

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.

DataNinja777
Super User
Super User

Hi @mohiniverma2704 ,

 

The robustness and reliability of Power BI and Power Pivot, compared to Excel, lie in their ability to perform calculations on entire columns rather than individual cells. As a result, it’s not possible to manually exclude specific rows without applying some logical criteria. My recommendation in this case is to introduce a field in your data table to flag the rows that should be excluded from the total. You can then use the 'calculate' function to exclude those flagged rows from the total calculation.

 

Best regards,

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors