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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Divide a measure by a measure

Hello, 

 

I don't know if this is the best way to go about this. I'm sure I could get this all done in the orginal formula, but I will explain what I have. Below I have two formulas that I need to divide formula 1 by formula 2. I'm gettting an infinte number when trying to do a simple =Divide(Measure1,Measure2).

 

Can anyone help me with this?

 

1.  CALCULATE(SUM(Hotel[Period 1 Hotel Booked Amount]),Hotel[Preferred Vendor Status]="Preferred")
2.  CALCULATE(SUM(Hotel[Period 1 Hotel Room Nights]),Hotel[Preferred Vendor Status]="Preffered")
 
Thank you!
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , this should work

 

measure 1= CALCULATE(SUM(Hotel[Period 1 Hotel Booked Amount]),Hotel[Preferred Vendor Status]="Preferred")
measure 2 CALCULATE(SUM(Hotel[Period 1 Hotel Room Nights]),Hotel[Preferred Vendor Status]="Preffered")

 

Measure 3 = divide([measure1],[measure2])

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , this should work

 

measure 1= CALCULATE(SUM(Hotel[Period 1 Hotel Booked Amount]),Hotel[Preferred Vendor Status]="Preferred")
measure 2 CALCULATE(SUM(Hotel[Period 1 Hotel Room Nights]),Hotel[Preferred Vendor Status]="Preffered")

 

Measure 3 = divide([measure1],[measure2])

Anonymous
Not applicable

Hello,

 

It works.... I'm a fool. Spelled Preferred wong in my second formula.

 

Thanks for your help!

 

You can also add a third argument to divide() for what to return if you have division by 0.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.