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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jja
Helper III
Helper III

Sum values excluding if row total sum is 0

Hi

I have such tabe

column1, column2,etc,etc,Total

27k,           -27k,    ,      ,        0

 

In the table i dont need to show records that total is 0 that is ok i use visual filter Total is greater then 0

 

But i also need to show column1(which values is a mesure) in a card as overall sum and if i simply sum this measure it includes this 27k where it should not include.

How should i calculate so that my calculations for summarizing column1 values exludes column1 value if the wholeor columns for that row sum is equal to 0

Total is also a measure in my table

5 REPLIES 5
Vera_33
Resident Rockstar
Resident Rockstar

Hi @jja 

 

Is Total a Calculated column in your table? If yes, you can filter it

Measure = SUMX(FILTER(yourTable,[Total]<>0),yourTable[Column1])

HI @Vera_33 

Column1 and Total is a measure in my visual table and your suggested formula does not filter out desired results. I create a measure for all columns and also create a measure for total. Then i add to my visuals a table and drag measures

Vera_33
Resident Rockstar
Resident Rockstar

Hi @jja 

 

So [column1] and [Total] are measures in a visual table...can you provide your current measure - sum of coumn 1 in a card visual or some sample data? You need to calculate column1 and total first, then filter total = 0 out then sum up column1 in a card, right?

hi @Vera_33 

Yes i need to filter total >0 and then sum up column1 in a card

DAX for column1=

CALCULATE(SUMX(SL03,SL03[SL03013]-SL03[SL03053]),
FILTER('Due Categories', 'Due Categories'[Due Category]="0-7"))
 
Vera_33
Resident Rockstar
Resident Rockstar

Hi @jja 

 

Can't tell from your measure that what you have for Rows...but you can try below way if you have one native column from your table to display in your visual table

 

test = 
VAR T1= ADDCOLUMNS(VALUES(yourTable[yourColumn]),"Column1",[Column1 measure],"Total",[Total measure])
RETURN
SUMX(FILTER(T1,[Total]>0),[Column1])

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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