Forum Discussion
Calculate Variation dynamically
- 5 years ago
Hi, GoncaloCare
If I understand what you mean, Do you want the value of Query3[MAT] to be dynamic?
You can try to create a single distinct list(distict(Query3[MAT])), then use this new table column as slicer. And use selectedvalue function to distinguish different values in two different tables.
-> for the first value: Mat1valor = CALCULATE(SUM(Query3[EUR]), Query3[MAT]=selectedvalue(Query3[MAT])) -> for the second value: VariacaoMAT1 = ( ( [Mat1valor] / CALCULATE(SUM(Query3[EUR]),selectedvalue(table[MAT]) ) - 1 ))If it doesn’t solve your problem, please share some sample fake data and your desired result,then feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Everything is possible with DAX... This is not dynamic since you've hard-coded the name "Mat1 into the measure. And then, again, you've hard-coded the other name "Mat2" into the other measure. No wonder this is static.
- GoncaloCare5 years agoHelper I
Hi Anonymous
Thanks for the reply.
I know I have hard-coded. My question is how to make it dynamic, because I don't have an Idea. I mean, I know how to make it dynamic for the first value (just selecting the mat 1 in the filters), but I don't know how to make it dynamic on the variation value.
The hard-code was the only way I was able to do to have an example.