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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
PowerRon
Post Patron
Post Patron

How to get right percentages in line chart with legend?

Hi,

I have this line chart showing the legend by numbers. Works fine

Knipsel1.JPGKnipsel2.JPG

 

 

 

 

 

But now I want it to show percentages instead of numbers. So what is the percentage of each legend-item each month?
I tried this

waarde =

VAR _waarde1 = [Number of Transactions]

VAR _waarde2 = CALCULATE([Number of Transactions], ALLSELECTED('Transactions Clearing Issuing'[Network Type Code]))

RETURN DIVIDE(_waarde1,_waarde2)

 

giving me this

 

Knipsel3.JPG

 

And I  tried this

 

waarde =

VAR _waarde1 = [Number of Transactions]

VAR _waarde2 = CALCULATE([Number of Transactions], ALLEXCEPT('Calendar Local Date', 'Calendar Local Date'[Year], 'Calendar Local Date'[Month Short ENG Name]))

RETURN DIVIDE(_waarde1,_waarde2)

 

giving me this

Knipsel4.JPG

 

In both solutions each month each lengend-item is 100%. What am I doing wrong?

Regards
Ron

 

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @PowerRon ,

 

You need to do the calculation based on the full network type and not on the months try something similar to this:

 

waarde =

VAR _waarde1 = [Number of Transactions]

VAR _waarde2 = CALCULATE([Number of Transactions], REMOVEFILTERS(Table[Network Type Code]))

RETURN DIVIDE(_waarde1,_waarde2)

 


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



View solution in original post

4 REPLIES 4
PowerRon
Post Patron
Post Patron

Hmm, now it is fluctuating between 99 and 101%. So be it. It's OK. Thnx for helping Felix

PowerRon
Post Patron
Post Patron

@MFelix you solved it. Thnx. 

One more question. I only select the three network types, mentioned in the legend, in the visual. 
Each month tehy sum up between 98 and 99,5%. Never 100%. Any idea what is the cause?

Because you look for all the networks and not only the 3 you select redo the metric to this one:

 

waarde =

VAR _waarde1 = [Number of Transactions]

VAR _waarde2 = CALCULATE([Number of Transactions], ALLSELECTED(Table[Network Type Code]))

RETURN DIVIDE(_waarde1,_waarde2)

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



MFelix
Super User
Super User

Hi @PowerRon ,

 

You need to do the calculation based on the full network type and not on the months try something similar to this:

 

waarde =

VAR _waarde1 = [Number of Transactions]

VAR _waarde2 = CALCULATE([Number of Transactions], REMOVEFILTERS(Table[Network Type Code]))

RETURN DIVIDE(_waarde1,_waarde2)

 


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
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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