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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Divide 2 Calculated Columns

I have these two columns as measures.  The work great as individual metrics. 

I want to divide these 2.  When I set up the following DAX I get "Infinity" as a result in my table.

 

SignupOpsPercent =
CALCULATE(COUNT(CallLogging[CALL_ID]),FILTER(CallLogging,CallLogging[CALL_TYPE]="signup"))/
CALCULATE(COUNT(CallLogging[CALL_ID]),FILTER(CallLogging,CallLogging[CALL_TYPE2]="Opps"))
 
Thanks for all the great help on this!
Scott
1 ACCEPTED SOLUTION

One thing I don't understand, you said you have 2 measures, so why are you not divinding those 2 using DIVIDE() function :

DIVIDE(measure1, measure2)

If you have 2 calculated columns, then it's different. (Calculated columns are visible in Data Vieaw and are calculating on each lines, measures are not visible in Data View but are listed in Field panel (with a specific icon, see below the black calculator is a measure, and the other one with a grey column, is calculated column). Measure can make a sum of a column for instance.

QUIZ_Icones_Mesure_Colonne.png).

 

Otherwise I think your trouble might be linked to the context of your table, could you tell us more about the context in which you are are trying to divide the 2.

View solution in original post

8 REPLIES 8
parry2k
Super User
Super User

@Anonymous try this

 

SignupOpsPercent =
DIVIDE(
CALCULATE(COUNT(CallLogging[CALL_ID]),CallLogging[CALL_TYPE]="signup"),
CALCULATE(COUNT(CallLogging[CALL_ID]),CallLogging[CALL_TYPE2]="Opps"),
0
)

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



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.

Anonymous
Not applicable

Parry, I tried this and all I get is 0 for every row. The same thing happens with IFERROR - all zeros.

One thing I don't understand, you said you have 2 measures, so why are you not divinding those 2 using DIVIDE() function :

DIVIDE(measure1, measure2)

If you have 2 calculated columns, then it's different. (Calculated columns are visible in Data Vieaw and are calculating on each lines, measures are not visible in Data View but are listed in Field panel (with a specific icon, see below the black calculator is a measure, and the other one with a grey column, is calculated column). Measure can make a sum of a column for instance.

QUIZ_Icones_Mesure_Colonne.png).

 

Otherwise I think your trouble might be linked to the context of your table, could you tell us more about the context in which you are are trying to divide the 2.

Anonymous
Not applicable

AilleryO, thanks for your help.  I discovered that one of my calculated fields was returning NULL.  I have resolved and now the DIVIDE calculation works.  Thank you!

Anonymous
Not applicable

The 2 fields are calculated just as above :

Opps = CALCULATE(COUNT(CallLogging[CALL_ID]),FILTER(CallLogging,CallLogging[CALL_TYPE2]="Opps"))
Signups = CALCULATE(COUNT(CallLogging[CALL_ID]),FILTER(CallLogging,CallLogging[CALL_TYPE]="signup"))
 
I tried this: DIVIDE([Signups],[Opps],0) and all it returns is 0 for every row.  I also tried DIVIDE(SUM([Signups]),SUM([Opps]),0) and this says Parameter is not correct.
 

CalFields.jpg

Anonymous
Not applicable

Call DIVIDE calc results.jpg

Could you add to your table the 2 measures to see what's their results in your table ?

Anonymous
Not applicable

Hi @Anonymous ,

 

Try using IFERROR function to your DAX measure.

That will solve the issue.

=IFERROR( value, value_if_error)

 

SignupOpsPercent =
IFERROR(CALCULATE(COUNT(CallLogging[CALL_ID]),FILTER(CallLogging,CallLogging[CALL_TYPE]="signup"))/
CALCULATE(COUNT(CallLogging[CALL_ID]),FILTER(CallLogging,CallLogging[CALL_TYPE2]="Opps")),0)
 
Thank you,
 
If this helps resolve your issue please mark it it as a solution

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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