Forum Discussion
Operate with 2 cards
- 8 years ago
Hey,
try this
the measure = DIVIDE( CALCULATE( ,COUNTROWS('yourtable') ,'yourtable'[colorcolumn] = "red" ) ,CALCULATE( ,COUNTROWS('yourtable') ,'yourtable'[colorcolumn] = "blue" ) )Regards
Tom
Hi TomMartens thanks for the answer.
Actually what I need is to divide the COUNT of 2 things.
Example:
I've got 100 values with color red. It does not matter what is the value. It could be A, B, C, anyone.
And I've got 75 values with clor blue and yellow. Same conditions, it does not matter the value, what I need is to know how many there are.
After that, I need to make the division of that 2 COUNTS.
Is it possible?
Sorry for my bad English.
Kind regards.
Hey,
try this
the measure =
DIVIDE(
CALCULATE(
,COUNTROWS('yourtable')
,'yourtable'[colorcolumn] = "red"
)
,CALCULATE(
,COUNTROWS('yourtable')
,'yourtable'[colorcolumn] = "blue"
)
)Regards
Tom
- chrisgehm8 years agoHelper III
Thanks!
- RWessels8 years agoNew Member
Hi Tom
Any chance you could help me with the syntax for the following pseudo measure code (only an example as the actual data is sensitive):
DIVIDE(
CALCULATE(
,COUNTROWS(UNIQUE('table'[field3]))
,'table'[field1] <= 17,'table'[field2] = "name"
)
CALCULATE(
,COUNTROWS('table')
,'table'[field2] = "name"
)
)
Essentially I want to count the number of unique values in field3 where field1 is less than or equal to 17 and field2 is "name" and divide that result by the count of the number of unique values in field3 where field2 is "name".
I currently have both those values in cards on my visualisation, but cannot seem to get the percentage of result 1 / result 2.
Hope that makes sense.
Much appreciated,
R.
- LarBo6 years agoFrequent Visitor
Hi TomMartens thank you for your answer, but what happens if red and blue values are not fixed, but ther are selected in two different selection box?
Is any option to do the same dinamically?
Thank you
- bull1234567896 years agoFrequent Visitor
Hi Tom
Thanks for this. I've spent too long trying to get this result until I found your messaure!
One thing, for me the mesaure only worked when I took out the commas (in Red below):
the measure =
DIVIDE(
CALCULATE(
,COUNTROWS('Table20')
,'Table20'[Status Fixed] = "Disengaged"
)
,CALCULATE(
COUNTROWS('Schedule20')
,'Table20'[Status Fixed] <> BLANK()
)
)*100Any thoughts why this might be?
Thanks
Duncan
- Anonymous4 years agoNot applicable