Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
85 | |
77 | |
66 |
User | Count |
---|---|
120 | |
112 | |
94 | |
84 | |
75 |