The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
I have a this measure to count rows of data by answer category:
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:
Can anybody help me with the measure please or what am I doing wrong with what I've done so far?
Thanks!
Solved! Go to Solution.
@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
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.
@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
Thank you.
User | Count |
---|---|
65 | |
60 | |
55 | |
54 | |
31 |
User | Count |
---|---|
180 | |
88 | |
70 | |
46 | |
46 |