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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
freakoushik
Frequent Visitor

Total Sum with a condition on rows

Hello everyone,

 

I have a situation where; I would like a conditional Total for all the three columns. Fig 1: Is the normal table function with the total sum (150,240,90).

 

freakoushik_0-1689772095167.png

 

My Requirement

I would like to see all the fruits in the table (also the Sum of Market Price, Sum of Selling Price, and Sum of Profits) but in the Total sum I’d like to subtract Mango and Orange. Below is how I would like my table to look like.

freakoushik_1-1689772095170.png

Total                    100                   160              60

 

Is there any DAX measure that can help me achieve this table?

 

Thankyou!

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

Jihwan_Kim_0-1689822368020.png

 

 

expected result measure: =
IF (
    HASONEVALUE ( Fruit[Fruit] ),
    SUM ( Data[Value] ),
    CALCULATE (
        SUM ( Data[Value] ),
        FILTER ( Fruit, NOT ( Fruit[Fruit] = "Mango" || Fruit[Fruit] = "Orange" ) )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hello,

 

Thanks for your reply. Unfortunately, I don't have the access to attach .pbix file in the thread. Please refer the below screenshot of the data(I hope this helps).

 

As you can see, there are 3 Types(Type 1, Type 2 and Type 3) with Part numbers and Description. When you select Type 1, i would lik to see data from all the columns but the sum of Col_1, Col_3 and Col_6 should not consider Part_1 or Desc_1, Part_5 or Desc_5 and Part_8 or Desc_8. But I want to see values in the table. 

 

The same logic should be applicable to Type_2 & Type_3.

 

freakoushik_0-1689920667684.png

 

 

Thankyou!

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.