Forum Discussion
felipe_pinto
4 years agoHelper I
Measure - How to define the maxx value using DAX
Hello guys, I have the measure below, wich I need to get the max value. This exemple, it shows me the week that had more request in the month. However, I also needed that the measure show me th...
- 4 years ago
Hi felipe_pinto
Try this to find the Name of the week:
Concentração DPP Name = VAR Semana1 = CALCULATE(COUNTROWS(fGeral),fGeral[Semana]=1,fGeral[Divisão SAP]=200) VAR Semana2 = CALCULATE(COUNTROWS(fGeral),fGeral[Semana]=2,fGeral[Divisão SAP]=200) VAR Semana3 = CALCULATE(COUNTROWS(fGeral),fGeral[Semana]=3,fGeral[Divisão SAP]=200) VAR Semana4 = CALCULATE(COUNTROWS(fGeral),fGeral[Semana]=4,fGeral[Divisão SAP]=200) Var _M = Maxx( UNION( Row("MEDIDA",Semana1), Row("MEDIDA",Semana2), Row("MEDIDA",Semana3), Row("MEDIDA",Semana4) ), [MEDIDA] ) return SWITCH(TRUE(), _M = Semana1,"Semana1", _M = Semana2,"Semana2", _M = Semana3,"Semana3", _M = Semana4,"Semana4" )Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
VahidDM
4 years agoSuper User
Hi felipe_pinto
Try this to find the Name of the week:
Concentração DPP Name =
VAR Semana1 = CALCULATE(COUNTROWS(fGeral),fGeral[Semana]=1,fGeral[Divisão SAP]=200)
VAR Semana2 = CALCULATE(COUNTROWS(fGeral),fGeral[Semana]=2,fGeral[Divisão SAP]=200)
VAR Semana3 = CALCULATE(COUNTROWS(fGeral),fGeral[Semana]=3,fGeral[Divisão SAP]=200)
VAR Semana4 = CALCULATE(COUNTROWS(fGeral),fGeral[Semana]=4,fGeral[Divisão SAP]=200)
Var _M =
Maxx(
UNION(
Row("MEDIDA",Semana1),
Row("MEDIDA",Semana2),
Row("MEDIDA",Semana3),
Row("MEDIDA",Semana4)
),
[MEDIDA]
)
return
SWITCH(TRUE(),
_M = Semana1,"Semana1",
_M = Semana2,"Semana2",
_M = Semana3,"Semana3",
_M = Semana4,"Semana4"
)
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
felipe_pinto
4 years agoHelper I
Hello VahidDM
Thank you so much 🙏 !!!!! That was what I exactly needed. 🙂 You rock!!!!😎
bcdobbs and AlexisOlson Thank you so much for your time too, you helped me a lot!
All the best to you!!