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
Anonymous
Not applicable

Using slicer and having line graph percents add to 100 help

Hello, 

 

I am still new to power BI and DAX. Currently I am trying to plot line graphs for survey questions that have a line for each response, and these were asked on a monthly basis. I have managed to figure out how to have the lines add up to 100% at each monthly interval using this formula 

 

% A2d Response1 =
CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[A2D] = "Response1" )
/ CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT('Table','Table'[Month]))
 
However, I also have lots of slicers on each dashboard page, and when they are replied I still need the percents at each month to add up to 100%. For example, the survey was asked in several countries, and when I select a country using slicer the percents at each month no longer add to 100. I have been trying to include them in the ALLEXCECPT function:
 
% A2d Response1 =
CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[A2D] = "Response1" )
/ CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT('Table','Table'[Month], 'Table'[Country]))
 
However, I get an error message saying cant convert value of type text to TRUE/FALSE. Does anyone know a way around this, or a different way of writing my measure to get it to work? Any help greatly appreciated!
 
Thanks!
3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @Anonymous ,

 

It would be better that you could provide some dummy data and the desired output, to describe what "have the lines add up to 100% at each monthly interval" means.

How to Get Your Question Answered Quickly

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-yulgu-msft ,

 

I think I actually managed to fix the problem, but will bear in mind for next time.

 

Thanks!

 

Hi @Anonymous ,

 

Would you please kindly share your solution so that others having similar concern can benefit from here?

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.