Forum Discussion
DIVIDE DAX with error when using 2 numerators
- 5 years ago
Hi Anonymous ,
I see.
If you return ICM,you will find that the measure without constant value still showing result only for 2021:
But the measure with constant value are showing values with all the years:
It means that the if condition doesn work in your measure,so try to modify your measure as below:
ICM MARG = VAR _ARG1 = [% MARGEM SM] - [LINHA BASE MARG] VAR ARG2 = [META MARG] - [LINHA BASE MARG] VAR ICM = DIVIDE(_ARG1, ARG2) //verificar porque quando o numerador do divide tem um número sendo subtraído a matriz perde o filtro do ano VAR RESUL = IF(ICM < 0, BLANK(), ICM) RETURN RESULAnd you will see:
The result only contains the value in 2021.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
Hi v-kelly-msft . I have a page filter defined to 2021 and the matrix show values to years 2016, 2017, 2018, etc, when I put a constant ( [LINHA BASE MARG] = 0.25 ) in numerator of divide. I don't wanna see values to other years.
I can't understand why the page filter doesn't works when I have a constant in numerator of divide. 🤷♂️
If the constant doesn't be there in numerator of divide, the page filter works decently.
Hi Anonymous ,
I see.
If you return ICM,you will find that the measure without constant value still showing result only for 2021:
But the measure with constant value are showing values with all the years:
It means that the if condition doesn work in your measure,so try to modify your measure as below:
ICM MARG =
VAR _ARG1 = [% MARGEM SM] - [LINHA BASE MARG]
VAR ARG2 = [META MARG] - [LINHA BASE MARG]
VAR ICM = DIVIDE(_ARG1, ARG2) //verificar porque quando o numerador do divide tem um número sendo subtraído a matriz perde o filtro do ano
VAR RESUL = IF(ICM < 0, BLANK(), ICM)
RETURN RESUL
And you will see:
The result only contains the value in 2021.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
- Anonymous5 years agoNot applicable
Awesome! Thank you!