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

Stacked Col Chart : Legends not working as expected with field parameters

Hello, 

 

I have a Stacked Column chart, Where x is type of subject and y is a field parameter with measures - attendence percentage and absent percentage. In the legends, I want to reasons why they were absent (sick, permission grated, no permission, attended, leave). 

 

When I add the legends with the measures. All the legends are set 100% and the actual % for various reasons don't show up. Where could it have gone wrong?

 

Can you help?

 

Table 

Subjects - English, Maths, Science, Social

attendence percentage measure - DIVIDE(countrows(ATTENDED),countrows(allvalues))

Reasons - sick, permission grated, no permission, attended, leave

 

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@rithu , You have create a measure like

 

 DIVIDE(countrows(filter( Table, Table[reasons]= "ATTENDED") ) ,calculate(countrows(Table, removefilters(Table[reasons] ) ) ) )

 

or

 

DIVIDE(countrows(Table) ,calculate(countrows(Table, removefilters(Table[reasons] ) ) ) )

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@rithu , You have create a measure like

 

 DIVIDE(countrows(filter( Table, Table[reasons]= "ATTENDED") ) ,calculate(countrows(Table, removefilters(Table[reasons] ) ) ) )

 

or

 

DIVIDE(countrows(Table) ,calculate(countrows(Table, removefilters(Table[reasons] ) ) ) )

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.