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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
pvtrinh89
Frequent Visitor

Divide a measure by two measure based on a dimension

Dear Experts,

I have a measure named sales containning amount of two lines retail and direct, so now i want to divide sales by 2 measures name sales_retail and sales_direct but i am unable to research for this, Did power bi can do that? has anyone can let me know the solution to compare between retail nad direct if power bi can not support to divide the sales measure.

 

Best regards.

J.

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

So you have a Measure named SALES

 

and you want to have 2 Measures SALES RETAIL = CALCULATE([SALES], TableName[Sales Category Column]="Retail")

 

and same for SALES DIRECT = CALCULATE([SALES], TableName[Sales Category Column]="Direct")

 

You can of course just create a Matrix add Sales Category and SALES Measure you already say you have and it will show you both Categories split.

 

But if you want 2 separate measures this should help you.

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@pvtrinh89, What @Sean says is correct in so far as the assumptions around your data model hold. Are you able to post sample data so that those assumptions can be confirmed or the solution can be modified to fit your data?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi Smoupre,

I have done as Sean help, thank for your support 🙂

Sean
Community Champion
Community Champion

So you have a Measure named SALES

 

and you want to have 2 Measures SALES RETAIL = CALCULATE([SALES], TableName[Sales Category Column]="Retail")

 

and same for SALES DIRECT = CALCULATE([SALES], TableName[Sales Category Column]="Direct")

 

You can of course just create a Matrix add Sales Category and SALES Measure you already say you have and it will show you both Categories split.

 

But if you want 2 separate measures this should help you.

Thanks Sean so much!

this is exactly i want to do.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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