Forum Discussion
darpao
5 years agoNew Member
Multiple response and filters
I have a survey that generate 2 tables, one main table like this (Main): ID Year Country 1 2018 UK 2 2019 USA 3 2019 USA 4 2020 Germany 5 2020 USA 6 2018 German...
- 5 years ago
Finally I was able to find the solution.
Thank you ERD because your code helped me.
This is what I was looking for:
#Percentage = VAR main_id = CALCULATE(COUNTROWS('T-main'),REMOVEFILTERS('T-tech'[Technology]))VAR tech_id = COUNT('T-tech'[ID])VAR percentage = tech_id / main_idRETURNCOALESCE(percentage,0)
ERD
5 years agoCommunity Champion
darpao ,
I'm not sure what do you mean. You can check what you get by separating the measure:
#tech_id = CALCULATE(COUNT('T-tech'[ID]))
#main_id = COUNT('T-main'[ID])
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
darpao
5 years agoNew Member
Finally I was able to find the solution.
Thank you ERD because your code helped me.
This is what I was looking for:
#Percentage = VAR main_id = CALCULATE(COUNTROWS('T-main'),REMOVEFILTERS('T-tech'[Technology]))
VAR tech_id = COUNT('T-tech'[ID])
VAR percentage = tech_id / main_id
RETURN
COALESCE(percentage,0)