Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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 🙂
Solved! Go to Solution.
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 🙂
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 🙂
Thanks! Here are my sample tables - I'm still not getting it to work.
@dtango9 please provide a sample table and expected output. Are you trying to create a calculated column or measure?
I am looking to create a calculated column that returns True or False/Yes or No if all the criteria is met.
So far I have:
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 🙂
This is excellent. Thank you so much for your help 🙂
User | Count |
---|---|
96 | |
85 | |
77 | |
66 | |
63 |
User | Count |
---|---|
110 | |
96 | |
96 | |
67 | |
59 |