Skip to main content
cancel
Showing results for 
Search instead 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

Reply
santossssshhh
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
parry2k
Super User
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.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



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.

parry2k
Super User
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.

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. problem.png

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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