Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
how can I convert this if statement to set analysis t
=if(
'$(vQty)' = 'Qty',
sum([ Quantity]),
sum ([Unit ] * [ Quantity])
)
Hi
Try like below
=if(
'$(vQty)' = 'Qty',
sum({<YEAR= {$(=MAX( YEAR)-1)}>}[ Quantity]),
sum ({<YEAR= {$(=MAX( YEAR)-1)}>}[Unit ] * [ Quantity])
)
What are you trying to achieve with set analysis that you don't in your current expression? I think your expression looks fine.
want to make the above expression to look at last year
like {$(=MAX( YEAR)-1)}
Hi
Try like below
=if(
'$(vQty)' = 'Qty',
sum({<YEAR= {$(=MAX( YEAR)-1)}>}[ Quantity]),
sum ({<YEAR= {$(=MAX( YEAR)-1)}>}[Unit ] * [ Quantity])
)