Forum Discussion
Help with DAX Statement
Hi,
I'm new to Power BI and am hoping someone can help. I'm looking to create a statement with the following criteria:
- Condition 1 = "Type A" AND Condition 2 = "Type B"
- Date Field # 1 = In the past
- Date Field # 2 = Today and in the future
Any help is greatly appreciated 🙂
Try something similar to this
Trial Offer = IF ( ( new_contract[subscription_type] = "Contract" || new_contract[new_dear] = "OFFER" ) && ( new_contract[subscriptioncancellationreason] <= TODAY () && new_contract[new_enddate] >= TODAY () ), "Yes", "No" )Without seeing your data model it is difficult to tell you the exact DAX. Please modify it based on your requirement.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
6 Replies
- nandukrishnavsCommunity Champion
You could use IF(), AND() , TODAY()
IF(<logical_test>,<value_if_true>[, <value_if_false>])AND(<logical1>,<logical2>)Please refer to this link for more understanding.
https://www.tutorialgateway.org/power-bi-dax-logical-functions/
If you are still confused, then provide your sample tables.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂- dtango9Helper II
Thanks! Here are my sample tables - I'm still not getting it to work.
- new_contract[subscription_type] = "Contract" AND new_contract[new_deal] = "OFFER"
- new_contract[new_subscriptioncancellationreason] is expired
- new_contract[new_enddate] is today or in the future
- nandukrishnavsCommunity Champion
dtango9 please provide a sample table and expected output. Are you trying to create a calculated column or measure?