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 Anonymous
add VAR for each equation then use them in Divide:
var _1 = A-B
var _2 = C-D
var _Divide = DIVIDE( _1 ,_ 2 , 0)
RETURN
_Divide
or use _Result = (A-B) / (C-D)
- Anonymous5 years agoNot applicable
The issue persist:
- aj19735 years ago
Community Champion
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.