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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
pieterhkruger
Frequent Visitor

Line graph percentages to sum to 100% by x-axis value

Hi,

 

Consider the following simple example of two possible line graphs based on counts:Line graph.GIF

What I want, however, is a graph with percentages (like the second one), but where the percentages are not in terms the overall total, but in terms of the totals for the x-axis values (i.e. subtotals by date).  In other words, for 01 May 2019, I want to have values 50% (3 / 6) for Group A and 50% (3 / 6) for Group B; for 02 May 2019, I want to have values 75% (6 / 😎 for Group A and 25% (2 / 😎 for Group B;  for 03 May 2019, I want 33% (2/6) and 66% (4/6) respectively.

 

How do I go about to do that?  (I suppose I need to create a measure in DAX, but I am not sure how to construct it).

 

Thanks.

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@pieterhkruger,

 

You can create two measures using DAX below:

Percentage Of Group A = CALCULATE(SUM('Table'[Count of Group]), FILTER(ALLEXCEPT('Table', 'Table'[Date]), 'Table'[Group] = "A")) / CALCULATE(SUM('Table'[Count of Group]), ALLEXCEPT('Table', 'Table'[Date]))

Percentage Of Group B = CALCULATE(SUM('Table'[Count of Group]), FILTER(ALLEXCEPT('Table', 'Table'[Date]), 'Table'[Group] = "B")) / CALCULATE(SUM('Table'[Count of Group]), ALLEXCEPT('Table', 'Table'[Date]))

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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