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
Denet
Regular Visitor

Measure SUM + IF

Dear all, please help. I have a table in which I want to separate debtors from creditors

 

Denet_0-1619597812896.png

 

I created 2 measures:

Debitors = IF(CALCULATE(SUM('Table'[Summ]))<0,CALCULATE(SUM('Table'[Summ])),0)
Creditors = IF(CALCULATE(SUM('Table'[Summ]))>0,CALCULATE(SUM(Table'[Summ])),0)
When I put them in Matrix Total is eq 0 or calculated incorrect. 

Denet_1-1619598508426.png

 

What i did wrong?

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Denet ,

 

Try to create another measures to get the right total value like so:

 

Debitors - Modified =
SUMX ( 'Table', [Debitors] )

 

Creditors - Modified =
SUMX ( 'Table', [Creditors] )

 

Please check if these measures could help you.

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Icey
Community Support
Community Support

Hi @Denet ,

 

Try to create another measures to get the right total value like so:

 

Debitors - Modified =
SUMX ( 'Table', [Debitors] )

 

Creditors - Modified =
SUMX ( 'Table', [Creditors] )

 

Please check if these measures could help you.

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Denet , Create three measures like

 

Summ value = SUM('Table'[Summ])


Debitors = sumx(filter( values(Table[Name]),[Summ value] <0), [Summ value])


Creditors = sumx(filter( values(Table[Name]),[Summ value] >0), [Summ value])

@amitchandak 

Tank you for idia but in this case it filters only pozitiv values of table (whithout calculating them)

Denet_0-1619677505296.png

Denet_1-1619677570556.png

 

And adding 

Summ value = CALCULATE(SUM('Лист2'[Сумма]))
The same do not give effect 

 

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.