Forum Discussion
max in pre-aggregate table
- 3 years ago
Goodnight
It's been a while since I've been back here, the truth is that with so much work sometimes time becomes too limited, however I didn't want to let this post go by without including the solution so that if someone else is in the same predicament they can find it here a guide and a solution.
Basically the syntax that works is:=
CALCULATETABLE (
ADDCOLUMNS ( ALL ( Calendario[Nombre del día] ), "@hurtos", [cantidad] ),
REMOVEFILTERS ( Calendario[Número del día] )
)this excellent video explains what is happening, it really is something that is not at all intuitive
Finally, the measure was needed to place a conditional format, therefore the final one is as follows:
color bars =
VAR table =
CALCULATETABLE (
ADDCOLUMNS ( ALL ( Calendar[Day name] ), "@thefts", [amount] ),
REMOVEFILTERS ( Calendar[Day of week] )
)
maximum VAR =
MAXX ( table, [@thefts] )
VARE color =
SWITCH ( TRUE (), [amount] >= maximum, "#8C0000", "#BDBEBF" )
RETURN
color
hope this helps in some way
Goodnight
It's been a while since I've been back here, the truth is that with so much work sometimes time becomes too limited, however I didn't want to let this post go by without including the solution so that if someone else is in the same predicament they can find it here a guide and a solution.
Basically the syntax that works is:
=
CALCULATETABLE (
ADDCOLUMNS ( ALL ( Calendario[Nombre del día] ), "@hurtos", [cantidad] ),
REMOVEFILTERS ( Calendario[Número del día] )
)
this excellent video explains what is happening, it really is something that is not at all intuitive
Finally, the measure was needed to place a conditional format, therefore the final one is as follows:
color bars =
VAR table =
CALCULATETABLE (
ADDCOLUMNS ( ALL ( Calendar[Day name] ), "@thefts", [amount] ),
REMOVEFILTERS ( Calendar[Day of week] )
)
maximum VAR =
MAXX ( table, [@thefts] )
VARE color =
SWITCH ( TRUE (), [amount] >= maximum, "#8C0000", "#BDBEBF" )
RETURN
color
hope this helps in some way