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
Anonymous
Not applicable

Totals Row behavior measure verse calculated column

Hi All,

 

I've been trying to work only with measures not calculated columns because I've seen a few people say that they are way better and can do everything, but I'm stuck on something I can't seem to do in a measure. I think in this case I actually need to use a calculated column, so hoping for a response from one of those people who have said they never use calculated columns because measures can do everything.

 

OnlyPositives = If([Value]>0,[Value],0)

 

Category       Value       OnlyPositives

A                     -5            0

B                      1             3

C                      2             4

Total               -2             0

 

This is what I currently have, but actually I want the total value of [OnlyPositives] to add up to 7. I understand that measures dont evaluate at a row level and therefore it is doing what I told it to, since -2 is >0 it is displaying 0.

 

My conclusion is that I do have to use calculated columns to do this. Which is quite frustrating because there are a tonne of measures which feed into [Value]. If I want to convert this to a calculated column I'm basically going to have to remake everything I've done in measures to calculated columns - which makes me want to just use calculated columns again in the future.

 

I have tried to make a single calculated column which references [Value] but I've spend a while on it already and am having trouble making it match up, so before I go further I was hoping to get a weigh in to make sure my thinking is right.

 

Thanks superstars.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous Have you tried sumx function

Measure = SUMX('Table',IF('Table'[Value]>0,'Table'[Value],0))

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous Have you tried sumx function

Measure = SUMX('Table',IF('Table'[Value]>0,'Table'[Value],0))

 

Anonymous
Not applicable

Thank you so much!

 

It's very basic but something I hadn't learnt yet.

 

Power BI Community to the rescue!

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.

Top Solution Authors