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.
Dear all,
I hope you can help me!? I do know, what I wanna do, but I cannot write in DAX.
Please find below what the relevant formula needs to do (in prose text), but how to write it as workable formula???
IF
'Sold to Customer'[Global Agreement] <> BLANK
AND
(SELECTEDVALUE('Sold to Customer'[Global Agreement]) = SELECTEDVALUE('Final Ship to Customer'[Global Agreement])
THEN
'Sold to Customer'[Global Agreement]
IF
'Final Ship to Customer'[Global Agreement] = BLANK
AND
(SELECTEDVALUE('Sold to Customer'[Global Agreement]) <> SELECTEDVALUE('Final Ship to Customer'[Global Agreement])
THEN
'Sold to Customer'[Global Agreement]
IF
'Sold to Customer'[Global Agreement] = BLANK
AND
'Final Ship to Customer'[Global Agreement] <> BLANK
AND
(SELECTEDVALUE('Sold to Customer'[Global Agreement]) <> SELECTEDVALUE('Final Ship to Customer'[Global Agreement])
THEN
'Final Ship to Customer'[Global Agreement]
IF
'Sold to Customer'[Global Agreement] <> BLANK
AND
'Final Ship to Customer'[Global Agreement] <> BLANK
AND
(SELECTEDVALUE('Sold to Customer'[Global Agreement]) <> SELECTEDVALUE('Final Ship to Customer'[Global Agreement])
THEN
'Sold to Customer'[Global Agreement]
Hopefully some of you can help me!?
Solved! Go to Solution.
Hi @Orstenpowers ,
This doesn't seem to be a problem with the formula logic, it could be a specific field in the table that is formatted incorrectly. Can you expand the "Final Ship to Customer" and "Sold to Customer" tables and replace the incorrect fields in the formulas with the correct fields in the tables.
If you are creating a measure, you need to add an aggregate value to the specific field in the formula, refer to the formula below:
A =
IF (
MAX('Sold to Customer'[Global Agreement]) <> BLANK()
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
= SELECTEDVALUE ( 'Final Ship to Customer'[Global Agreement] )
),
MAX('Sold to Customer'[Global Agreement]),
IF (
MAX('Final Ship to Customer'[Global Agreement]) = BLANK()
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
<> SELECTEDVALUE ('Final Ship to Customer'[Global Agreement] )
),
MAX('Sold to Customer'[Global Agreement]),
IF (
MAX('Sold to Customer'[Global Agreement]) = BLANK()
&& MAX('Final Ship to Customer'[Global Agreement]) <> BLANK()
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
<> SELECTEDVALUE ( 'Final Ship to Customer'[Global Agreement] )
),
MAX('Final Ship to Customer'[Global Agreement]),
IF (
MAX('Sold to Customer'[Global Agreement]) <> BLANK()
&& MAX('Final Ship to Customer'[Global Agreement]) <> BLANK()
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
<> SELECTEDVALUE ( 'Final Ship to Customer'[Global Agreement] )
),
MAX('Sold to Customer'[Global Agreement])
)
)
)
)
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Orstenpowers ,
This doesn't seem to be a problem with the formula logic, it could be a specific field in the table that is formatted incorrectly. Can you expand the "Final Ship to Customer" and "Sold to Customer" tables and replace the incorrect fields in the formulas with the correct fields in the tables.
If you are creating a measure, you need to add an aggregate value to the specific field in the formula, refer to the formula below:
A =
IF (
MAX('Sold to Customer'[Global Agreement]) <> BLANK()
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
= SELECTEDVALUE ( 'Final Ship to Customer'[Global Agreement] )
),
MAX('Sold to Customer'[Global Agreement]),
IF (
MAX('Final Ship to Customer'[Global Agreement]) = BLANK()
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
<> SELECTEDVALUE ('Final Ship to Customer'[Global Agreement] )
),
MAX('Sold to Customer'[Global Agreement]),
IF (
MAX('Sold to Customer'[Global Agreement]) = BLANK()
&& MAX('Final Ship to Customer'[Global Agreement]) <> BLANK()
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
<> SELECTEDVALUE ( 'Final Ship to Customer'[Global Agreement] )
),
MAX('Final Ship to Customer'[Global Agreement]),
IF (
MAX('Sold to Customer'[Global Agreement]) <> BLANK()
&& MAX('Final Ship to Customer'[Global Agreement]) <> BLANK()
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
<> SELECTEDVALUE ( 'Final Ship to Customer'[Global Agreement] )
),
MAX('Sold to Customer'[Global Agreement])
)
)
)
)
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Orstenpowers ,
Please try this:-
A =
IF (
'Sold to Customer'[Global Agreement] <> BLANK
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
= SELECTEDVALUE ( 'Final Ship to Customer'[Global Agreement] )
),
'Sold to Customer'[Global Agreement],
IF (
'Final Ship to Customer'[Global Agreement] = BLANK
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
<> SELECTEDVALUE ( 'Final Ship to Customer'[Global Agreement] )
),
'Sold to Customer'[Global Agreement],
IF (
'Sold to Customer'[Global Agreement] = BLANK
&& 'Final Ship to Customer'[Global Agreement] <> BLANK
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
<> SELECTEDVALUE ( 'Final Ship to Customer'[Global Agreement] )
),
'Final Ship to Customer'[Global Agreement],
IF (
'Sold to Customer'[Global Agreement] <> BLANK
&& 'Final Ship to Customer'[Global Agreement] <> BLANK
&& (
SELECTEDVALUE ( 'Sold to Customer'[Global Agreement] )
<> SELECTEDVALUE ( 'Final Ship to Customer'[Global Agreement] )
),
'Sold to Customer'[Global Agreement]
)
)
)
)
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Thx for your prompt reply!
I inserted your proposal and got following error message: "Wrong syntax for "&&"
What do I need to adjust???
@Orstenpowers , Can you please share the screenshot of the error with your code pls?
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
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 |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |