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

Create a percentage line chart...by month

Hi, I have two contents in a column, "Yes" and "No" and I want to create a line chart that shows the "Yes" as a percentage by month.

 

However, in my line chart, I can only get this as count data like this.

 

Someone, please helpCapture.JPG

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

Hi @melvinkishore

Create a measure

percentage =
DIVIDE (
    CALCULATE (
        COUNT ( Sheet4[column] ),
        FILTER ( ALLEXCEPT ( Sheet4, Sheet4[month] ), [column] = "yes" )
    ),
    CALCULATE ( COUNT ( Sheet4[column] )ALLEXCEPT ( Sheet4, Sheet4[month] ) )
)

Then add this measure to the "Value" field of the Line chart. (note the data format of the measure should be "percentage".)

8.png

 

 

Best Regards

Maggie

 

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @melvinkishore

Create a measure

percentage =
DIVIDE (
    CALCULATE (
        COUNT ( Sheet4[column] ),
        FILTER ( ALLEXCEPT ( Sheet4, Sheet4[month] ), [column] = "yes" )
    ),
    CALCULATE ( COUNT ( Sheet4[column] )ALLEXCEPT ( Sheet4, Sheet4[month] ) )
)

Then add this measure to the "Value" field of the Line chart. (note the data format of the measure should be "percentage".)

8.png

 

 

Best Regards

Maggie

 

Anonymous
Not applicable

Hi @v-juanli-msft,

 

Thank you for your replay. 

I tried to adapt this solution to my need, it seems that I wanted to do the same. I have a column with 'Auto' and 'Manual' and I want to have a chart with a percentage of 'Auto' by month. 

 

Unfortunately, my chart is flat, the same value every month. What is wrong?

auto po error.PNG

 My function:

AutoPOpercent = DIVIDE(CALCULATE(COUNT('PO Data'[Auto PO]); FILTER(ALLEXCEPT('PO Data';'PO Data'[Month]);'PO Data'[Auto PO] = "Auto")); CALCULATE(COUNT('PO Data'[Auto PO]);ALLEXCEPT('PO Data';'PO Data'[Month])) )

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.