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
Hey,
try this
the measure =
DIVIDE(
CALCULATE(
,COUNTROWS('yourtable')
,'yourtable'[colorcolumn] = "red"
)
,CALCULATE(
,COUNTROWS('yourtable')
,'yourtable'[colorcolumn] = "blue"
)
)Regards
Tom
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.