The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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 🙂
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+1
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@FZOU what you mean by product not empty? It is not very clear what refers to product empty or not empty?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2kthank you for your reply,empty it's mean sometimes we don't have a product but we have the months,percent,appliedyear.
User | Count |
---|---|
65 | |
59 | |
55 | |
53 | |
30 |
User | Count |
---|---|
180 | |
88 | |
72 | |
48 | |
46 |