Forum Discussion
Help with DAX
Hello,
I want to do a dax formula but i didn't figure out how to do it,EXP :
I have this table which contain : Product,Month,Percent(percent discount per month),AppliedYear(the year to apply the percent,0=CurrentYear(2020);1=2021;2=2022.....
I added a whatifparam which contain values from 1 to 30 for the choosen Appliedyear by user(if there is any other better solution i'll take it)
the need is : if Product is not empty then we display the product with applied year = paramAppliedyear(choosen by user) if we haven't an appliedyear so we take the first smallest applied else we take the first greatest appliedyear.
to be clear : paramAppliedYear=1;if product not empty we display product with appliedyear =1 else product with appliedyear=0 else Productyear with appliedyear=2..
The PBIX file link on drive : https://drive.google.com/open?id=1J4xlclwiGPX8876UG8iuguAQAfG7BZQW
Thank you 🙂
4 Replies
- v-lionel-msftCommunity Support
Hi FZOU ,
Is this logic?
When paramAppliedYear = x
if products <> blank()
display products where appliedyear =x
else
display products where appliedyear=x-1 && appliedyear = x+1Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- FZOUHelper IV
v-lionel-msft, it's the demand like that,is this not logic !?