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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
ash757
Frequent Visitor

Need help with custom measure creation

Hi,

I have a function which calculates the Profit/Loss for the category in sales. But the problem is when most of the Orders are in payout pending bucket, Net Profit is obviously high.

ash757_1-1735209757756.png

 

What I want is to exclude Payout Pending rows when calculating the Net Profit by category but it also affects my bar graph which is cumbersome. 

ash757_2-1735209853699.png

Please help!

Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ash757 ,

Based on the testing, try using the following DAX formula to calculate the profit exclude payout pending.

vjiewumsft_0-1735267957489.png

Net Profit = 
   CALCULATE(
       SUM(Snapdeal[Payable]) - SUM(Snapdeal[Cost]),
       FILTER(Snapdeal, Snapdeal[Bucket] <> "Payout Pending" && Snapdeal[Bucket] <> "Cancelled")
   )

The result is shown below.

vjiewumsft_1-1735267965976.png

 

Best Regards,

Wisdom Wu

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

Hi @ash757 ,

Based on the testing, try using the following DAX formula to calculate the profit exclude payout pending.

vjiewumsft_0-1735267957489.png

Net Profit = 
   CALCULATE(
       SUM(Snapdeal[Payable]) - SUM(Snapdeal[Cost]),
       FILTER(Snapdeal, Snapdeal[Bucket] <> "Payout Pending" && Snapdeal[Bucket] <> "Cancelled")
   )

The result is shown below.

vjiewumsft_1-1735267965976.png

 

Best Regards,

Wisdom Wu

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

This works exactly as I wanted, Thanks!
Also, Can you tell me What's the function of "&&" and how is it different from "&"?

danextian
Super User
Super User

Hi @ash757 

 

Simply based on the information provided,  I would create this measure:

CALCULATE ( [net profit], KEEPFILTERS ( 'table'[payout pending] = "no" ) )

 

Otherwise, please provicde a workable sample data (not an image), your expected result from that and the reasoning behind. https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.