Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey, guys. I've written a measure with DAX in order to check HOW MANY and WHICH questions meet certain criteria:
questions_block_N1_V1 = IF([%_compliance_trabalhista_red] <> 1, (CALCULATE( COUNT('5_es_individual_compliance'[id_question]), '5_es_individual_compliance'[question_class] IN {"red"}, '5_es_individual_compliance'[compliance_status] IN {"False"}, '5_es_individual_compliance'[topic_txt] IN {"Trabalhista", "Empregados Próprios", "Consórcio", "Terceiros", "Prestadores de Serviço", "Prevenção de Riscos e Acidentes", "Solo", "Plantio", "MIP", "Adubação", "Gestão", "Queima", "Agroquímicos", "Recursos hídricos", "Floresta"})), 0) + IF([%_compliance_trabalhista_purple] < 0.75, (CALCULATE( COUNT('5_es_individual_compliance'[id_question]), '5_es_individual_compliance'[question_class] IN {"purple"}, '5_es_individual_compliance'[compliance_status] IN {"False"}, '5_es_individual_compliance'[topic_txt] IN {"Trabalhista"})), 0) + IF([%_compliance_trabalhista_blue] < 0.5, (CALCULATE( COUNT('5_es_individual_compliance'[id_question]), '5_es_individual_compliance'[question_class] IN {"blue"}, '5_es_individual_compliance'[compliance_status] IN {"False"}, '5_es_individual_compliance'[topic_txt] IN {"Trabalhista"})))
For the example below, this function gives the result 2, which is correct. But when I add the list of questions to be flagged (so I get to know which ones are these 2), something goes wrong:
It should only show with "1" the questions circled in red. Not sure what I'm doing wrong here. Any help is really appreciated!
Solved! Go to Solution.
Hoi! It looks like you're trying to do quite some operations in that one big query... break it up into 3 dimensions for now and see what each one is answering... perhaps it's an ordering thing? I can't really tell because I can't understand the logic (since you haven't shown all the data.)
If the problem is just in the last visual, you circled two reds and the answer is two... so is it perhaps just ADDING instead of taking the mean or something like that?
Hoi! It looks like you're trying to do quite some operations in that one big query... break it up into 3 dimensions for now and see what each one is answering... perhaps it's an ordering thing? I can't really tell because I can't understand the logic (since you haven't shown all the data.)
If the problem is just in the last visual, you circled two reds and the answer is two... so is it perhaps just ADDING instead of taking the mean or something like that?
I closed this topic because it was duplicated, gonna concentrate this discussion here: https://community.powerbi.com/t5/Desktop/Result-of-measure-is-correct-but-it-s-flagging-wrongly/m-p/...
Cheers!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
99 | |
73 | |
72 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |