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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Fusilier2
Helper V
Helper V

Help with % measure

Hi,

I have a this measure to count rows of data by answer category:

AnswerCount = COUNTROWS('Combined Table').
I've created this matrix using it:
matrix.PNG

I want to display the answer category as a % of all categories in a line chart but can't work out the syntax for the measure.

I've managed to add in the %CT column as 'show values as % of column Total'

 

But when I try to display this in a line chart it is showing different percentages:

chart4.PNG

Can anybody help me with the measure please or what am I doing wrong with what I've done so far?

Thanks!

 
 
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Fusilier2 So I would think your measure would need to be something like this for the line chart:

Measure =
  VAR __CurrentCount = COUNTROWS( 'Combined Table' )
  VAR __Year = MAX( 'Combined Table'[Year] )
  VAR __Table = FILTER( ALL( 'Combined Table' ), [Year] = __Year )
  VAR __AllCount = COUNTROWS( __Table )
  VAR __Result = DIVIDE( __CurrentCount, __AllCount )
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @Fusilier2 ,

 

Did you solve your problem, if so, you can mark the correct answer, if not, provide more detailed information and we can help you better!

 

Best Regards,

Liu Yang

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

Greg_Deckler
Community Champion
Community Champion

@Fusilier2 So I would think your measure would need to be something like this for the line chart:

Measure =
  VAR __CurrentCount = COUNTROWS( 'Combined Table' )
  VAR __Year = MAX( 'Combined Table'[Year] )
  VAR __Table = FILTER( ALL( 'Combined Table' ), [Year] = __Year )
  VAR __AllCount = COUNTROWS( __Table )
  VAR __Result = DIVIDE( __CurrentCount, __AllCount )
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors