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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
minerallife
Regular Visitor

How to create chart from count itself and show as percentage

minerallife_0-1704283446767.png
how to create this chart by count "Custom Column" and show it as 2 line (Count itself and show as percentage)
i have date dimention too it's name as "Month&Year"
minerallife_1-1704283763202.png

 

1 ACCEPTED SOLUTION
v-weiyan1-msft
Community Support
Community Support

Hi @minerallife ,

 

Based on your description,
you might consider using the following code to create two Measures.
My Sample:

vweiyan1msft_0-1705806658909.png

Sub portion = 
VAR Total = COUNT('Table'[Custom Column])
RETURN 
DIVIDE(COUNTX(FILTER('Table','Table'[Custom Column] = "SUB"),[Custom Column]), Total)
OD portion = 
VAR Total = COUNT('Table'[Custom Column])
RETURN 
DIVIDE(COUNTX(FILTER('Table','Table'[Custom Column] = "OD"),[Custom Column]), Total)

Result is as below.

vweiyan1msft_1-1705806713273.png

Is this the result you expect?
For further details, please find attachment.
If I've misunderstood you, please provide detailed sample data and the results you are hoping for. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.

 

Best Regards,
Yulia Yan

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-weiyan1-msft
Community Support
Community Support

Hi @minerallife ,

 

Based on your description,
you might consider using the following code to create two Measures.
My Sample:

vweiyan1msft_0-1705806658909.png

Sub portion = 
VAR Total = COUNT('Table'[Custom Column])
RETURN 
DIVIDE(COUNTX(FILTER('Table','Table'[Custom Column] = "SUB"),[Custom Column]), Total)
OD portion = 
VAR Total = COUNT('Table'[Custom Column])
RETURN 
DIVIDE(COUNTX(FILTER('Table','Table'[Custom Column] = "OD"),[Custom Column]), Total)

Result is as below.

vweiyan1msft_1-1705806713273.png

Is this the result you expect?
For further details, please find attachment.
If I've misunderstood you, please provide detailed sample data and the results you are hoping for. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.

 

Best Regards,
Yulia Yan

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@minerallife , Percent of total ?

 

Two measures

M1 = count(Table[Custom])

 

M1 % = divide(count(Table[Custom]) , calculate(count(Table[Custom]) , allselected()) )

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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