cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## get total value at the bottom after applying if condition to our column

I am working on a trial balance report where i have values like opening debit and credit, periodic debit and credit and closing debit and credit. While calculatinng opening debit and credit, I use a condition - if(debit > credit, debit - credit,0) for debit column and

if(credit > debit, credit - debit,0). It works well for the above rows, but I don't get total sum of these values at the bottom. I need the total values at the bottom. I've searched all over the internet but couldn't find it.
Is there anyone to help me with this???

3 REPLIES 3
Super User

@santossssshhh provide more details, how your data model looks like? What you are using on the rows. Read this post to get your answer quickly.

Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤

Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Super User

@santossssshhh change your measure to this:

``````SUMX ( VALUES ( YourTable[ColumnOnRow] ),
if(credit > debit, credit - debit,0)
)``````

Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤

Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Frequent Visitor

It doesn't work. Have a look on my table. It compares the first two columns and uses the formula for finding greater value and subtracting. I need the sum of all the rows compared.