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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
tlundman
Regular Visitor

Dividing Count of one Visual by the Count of a Second Visual

Hello All,

 

I am sure this is a novice question but I cannot figure this out.

 

I have one table that has been created using a SQL query.  I have filtered this table based on a date\time field to create one 'Count (Distinct)' for visual number one.  I filtered the same table with different date\time parameters to create a second 'Count (Distinct)' for visual number two.  I need to find a way to to divide the count of visual number two by the count of visual number one to return a percentage.

 

Is this possible?

8 REPLIES 8
robertdseals
New Member

Would love to know if this was solved.  I'm running into the same issue.  I have to visuals (one from one table calculating the count of rows based on one set of date slicers and another visual calculating number of rows from a second table based on a second set of date slicers and I would love to divide them, but dividing the measures isn't working. 

NewDivide = divide([Filtered Hire Rows],[Filtered Term Rows],0)
Nathaniel_C
Super User
Super User

Hi @tlundman ,

 

Yes it can be done.  As you can see in my picture, I have two visuals. I create the third measure using DIVIDE(). Just format the measure as a percentage.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

Divide percent.PNG





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

Proud to be a Super User!




I receive the above shown error when attempting to do what you are describing.  As you can see the names of the visuals do exist.  I am obviously referencing the numerator and the denominator incorrectly.  I did rename these.  Does that matter?

Hi @tlundman ,

What is the measure formula? [PA Received To day] = ??? and [PA Shipped On Time Today] = ???

 

And when you say your renamed them, what do you mean?

 

If you just changed the visual name, trying using the underlying name of the measure.  For instance, I notice that in your measure you have it called [Percent Shipped on Time Today] but it looks like the visual is [PA Total Shipped Today] (Unless that is a totally different visual)  

 

Thank you for the clarification. Let me know if that works.   

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





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

Proud to be a Super User!




Hello Nathaniel,

 

First off, I really appreciate the help.  I know this is voluntary.

 

The PA Total Shipped Today is not relevant to this discussion.  I was just trying to show the entire error message in the snip.

 

The 'PA Received Today' number is derived from a table that was created using a SQL query.  I then filtered that table on one date\time parameter and one location parameter.  I then used the Count (Distinct) function on that filtered subset on the Order No. column  returning a count of order numbers received during a given time period.  The PA Shipped On Time Today is a subset of the same above mentioned table that has had two date\time filters added and one Location Code filter.  I then used the same Count (Distinct) function on the Order No. column to gain the number seen in the visual.  I  need to create some sort of visual that divides the number of order shipped on time today by the the number of orders received today, resulting in an on time shipping percentage.  I hope that helps.

 

After writing this I am thinking that I may need to be using the same metric mentioned in your above post on the Order No. column instead of trying to plug in names that I have assigned to visuals.  What do you think?

Hi @tlundman ,

So if I take the two numbers that you are showing, and create a measure that shows each, and then create a third measure using the DIVIDE() I will get a percentage. (Format this measure as a percentage). Please see the picture below.  The important thing is that you use the final measures that you used to create the visual.  Can you give me a picture like I have given you below if this does not work? I just copied each measure into the text box.

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

ontime shipping.PNG

 

 





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

Proud to be a Super User!




 

Capture.PNG

MFelix
Super User
Super User

Hi @tlundman ,

 

You have very few information can you please see this post regarding How to Get Your Question Answered Quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490 (courtesy of @Greg_Deckler).

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.