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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Antonio_Gomez
Resolver I
Resolver I

Percent of Column Total in a Line Chart

Hello Everyone!

 

My today's issue is this:

 

I have 2 main tables. One is for the dates and another for the values. So, I was able to make the following matrix.

 

Antonio_Gomez_0-1657274258537.png

 

Where in rows are the types of ships, in columns the years and in values the measure Cant = COUNT('RIESGOS'[ATRAQUE]).

 

In order to put the porcentage I selected the option "Percent of column total" as you can see in the picture below.

 

Antonio_Gomez_1-1657275451650.png

 

 

But, this option is not available for the Line Chart. How is the measure that I should do?

 

I want something like this

 

Antonio_Gomez_0-1657276839718.png

 

Where the individual values for each year add up to 100% (The axis is years, the legend type of ship and the values the percentage)

 

 

I tried this formula, but give me the percentage for the grand total:

 

Pct =
DIVIDE(
COUNT('RIESGOS'[ATRAQUE])
,CALCULATE(
COUNT('RIESGOS'[ATRAQUE])
,ALLSELECTED('RIESGOS')
)
)

 

And others similiarwith the same result

 

 

Please, I need some help!!!!

 

 

1 ACCEPTED SOLUTION

@Ramjothi I found the formula in the example 3 of the documents

 

https://docs.microsoft.com/es-es/dax/all-function-dax

 

Pct4 = DIVIDE(
COUNTX(
'RIESGOS'
,'RIESGOS'[ATRAQUE])
,CALCULATE(
COUNT('RIESGOS'[ATRAQUE])
,ALL('RIESGOS'[TipoDeBarco]))
)

View solution in original post

3 REPLIES 3
Ramjothi
Regular Visitor

There is a similar kind of issue discussed in below topic and please try the solution as well.

Solved: Re: Replicate "Percent of column total" in a line ... - Microsoft Power BI Community

Hello @Ramjothi ,

 

Thanks for participate, I saw that discussion but I didn't know how to adapt it to my case. My values are texts so I can do SUM nor MAX.

 

And for the other hand, I don't know what to put here "ALLEXCEPT(Sheet1,Sheet1[Date],Sheet1[Question],Sheet1[Country])"

 

 

 

 

 

@Ramjothi I found the formula in the example 3 of the documents

 

https://docs.microsoft.com/es-es/dax/all-function-dax

 

Pct4 = DIVIDE(
COUNTX(
'RIESGOS'
,'RIESGOS'[ATRAQUE])
,CALCULATE(
COUNT('RIESGOS'[ATRAQUE])
,ALL('RIESGOS'[TipoDeBarco]))
)

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.