Forum Discussion
Gauge Chart Dynamic Maximum Value
- Anonymous4 years ago
Hi tamerj1
I got it to work!! Thank you so so much for helping me out!Current CTR (Gauge) = CALCULATE( [Avg CTR], FILTER( 'GSC query analysis', RELATED('Calendar Lookup'[Start of Month]) = MAXX('Calendar Lookup', 'Calendar Lookup'[Start of Month]) ) )
Since the 'Start of Month' column is from the Calendar Lookup Table, so I changed that line in your code, so it looks below:
Max CTR =
MAXX (
SUMMARIZE (
'GSC query analysis',
'Calendar Lookup'[Start of Month],
'GSC query analysis'[Category],
'GSC query analysis'[Query]
),
CALCULATE ( DIVIDE ( [Sum Clicks], [Sum Impressions], 0 ) )
)
This is how it looks like
Still not correct..
And if choosing multiple queries, this is how it looks like:
Not correct either.
Anonymous
Please try
Max CTR =
MAXX (
CROSSJOIN (
VALUES ( 'Calendar Lookup'[Start of Month] ),
SUMMARIZE (
'GSC query analysis',
'GSC query analysis'[Category],
'GSC query analysis'[Query]
)
),
CALCULATE ( DIVIDE ( [Sum Clicks], [Sum Impressions], 0 ) )
)- Anonymous4 years agoNot applicable
Hey tamerj1
I used your code, but it's giving me the same result, so it's still incorrect.
Single query selected:
Multiple queries selected:
But I think we are getting there. I think it's still doing the calculatation on the row basis, instead of column as a whole.
- tamerj14 years ago
Community Champion
Anonymous
It allways goves the vslue of the last date. I wonder why!
Would you please activate the row totals and see emwhat is the value shown at the total
- Anonymous4 years agoNot applicable
I used this code and turned on the subtotal in the matrix.:
Max CTR = MAXX ( CROSSJOIN ( VALUES ( 'Calendar Lookup'[Start of Month] ), SUMMARIZE ( 'GSC query analysis', 'GSC query analysis'[Category], 'GSC query analysis'[Query] ) ), CALCULATE ( DIVIDE ( [Sum Clicks], [Sum Impressions], 0 ) ) )It seems like if only selecting one query, the total of the Max CTR would show the correct value that I want!
ex1:ex2:
However, if selecting multiple queries. The total of Max CTR will show only the biggest max ctr out of all the individual queries (0.25), instead of collectively "Sum Clicks of all queries / Sum Impressions of all queries" which shuold be 0.07 in this case.