Forum Discussion
Alopez11
4 years agoRegular Visitor
Count Data, Help Again
Hello, I need a hand with a Dax formula I got the following data set: Date Time T° 1-1-2011 0:30 3 1-1-2011 01:00 3,5 1-1-2011 01:30 3 1-1-2011 02.00 3 Etc...
Anonymous
4 years agoNot applicable
Hi Alopez11 ,
So based on your data sample, the output should be:
If so, please modify the Flag measure:
Flag =
var _min=CALCULATE(MIN('Hoja1'[T°]),FILTER(ALL(Hoja1),[fecha]=MAX('Hoja1'[fecha])-1))
var _max=CALCULATE(MAX('Hoja1'[T°]),FILTER(ALL(Hoja1),[fecha]=MAX('Hoja1'[fecha])-1))
return
CALCULATE(DISTINCTCOUNT(Hoja1[fecha]),FILTER('Hoja1',10<=_min && 20<=_max))
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Alopez11
4 years agoRegular Visitor
Anonymous
I'm really thankfull for your help,
I have to adapt a little bit the formula and i mannage to get the right flags, but I need to count hoy many flags I have in a labbel so I can tell, this month we hace 5 flags in example. How can I do that?
Flag =
var _min='Base de Datos'[T° Min]
var _max=CALCULATE(MAX('Base de datos'[T°]),filter(ALLSELECTED('Base de Datos'),'Base de Datos'[fecha]=max('Base de Datos'[fecha])-1))
return
CALCULATE(DISTINCTCOUNT('Base de datos'[fecha]),FILTER('Base de datos',10<=_min&&20<=_max)
)