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
melvinkishore
Frequent Visitor

Measure to calculate percentage

I have a column with digits from 0 - 9, and I want a measure to calculate the percentage for of the count of each of the digits 0 - 9 relative to the total count of digits in the column.

1 ACCEPTED SOLUTION

Hi,

 

Try this measure.  Format it as a %

 

=COUNT(Data[First Digit])/CALCULATE(COUNT(Data[First Digit]),ALL(Data[First Digit]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
v-yuta-msft
Community Support
Community Support

Hi melvinkishore,

 

'I want a measure to calculate the percentage for of the count of each of the digits 0 - 9 relative to the total count of digits in the column.'

 

<--- Could you share some sample data and clarify more details about your logic and expected result?

 

Regards,

Jimmy Tao

Hi Jimmy Tao,

 

I have shared the data and the solution. I can get the solution easily on a pivot table but need help with DAX.Data & Solution.JPG

Hi,

 

Try this measure.  Format it as a %

 

=COUNT(Data[First Digit])/CALCULATE(COUNT(Data[First Digit]),ALL(Data[First Digit]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I got this error message Error message.JPG

You are missing 2 closing brackets, one before / and another before ,.  Look at my formula carefully.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank You Anish, I managed to get the output I wanted.

 

 

Much appreciated, Melvin

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.