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!
The issue persist:
Can you verify and RETURN
ARG1
ARG2
and show the result please?
- Anonymous5 years agoNot applicable
Arg1 and Arg2 below:
There isn't problem with the arg values.
I've found if I set the year filter in visual, it works. But I already have a year filter defined in the page filters.
- Anonymous5 years agoNot applicable
NEWS:
my measure use a constant value, then it is going to show for all dates regardless how I filter it because the measure is always returning a value. But, how to solve this? - aj19735 years ago
Community Champion
From your visual I can see ARG1 < 0 and ARG2 > 0 when you divide them the result ICM is always < 0 .
In your IF statment
you wanted to RETURN 0 if ICM < 0. That<s why you see 0 in your visual.
- Anonymous5 years agoNot applicable
The zero is not the problem, show zero to years 2016, 2017, 2018, etc when I have a filter defined to 2021 is the problem. I don't wanna see values to other years.
Here a similar discussing: https://community.powerbi.com/t5/Desktop/Slicer-not-filtering-measure-with-constant-value-over-date-range/m-p/1933589