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 all,
Hope someone can help me to convert below DAX formula to power Query M formula
Thanks, John
time_ordered =
IF (
'daily_event_reefer_report (2)'[event_type_gkey] = 241,
IF (
'daily_event_reefer_report (2)'[event_type_gkey_previous] = 243,
'daily_event_reefer_report (2)'[placed_time_previous],
0
),
IF (
'daily_event_reefer_report (2)'[event_type_gkey] = 240,
IF (
'daily_event_reefer_report (2)'[event_type_gkey_previous] = 242,
'daily_event_reefer_report (2)'[placed_time_previous],
0
),
0
)
)
Solved! Go to Solution.
You'll want to add a custom column and write a reasonably complex if.. then.. else statement to cope with the different cases. Looks like it's just a matter of working through it. Is that enough to help you progress?
I agree with @HotChilli
Add custom column and in the custom column formula use; make sure if then else is in lower case (it will show blue color). nested lines is more of readability
if ...
then
if
then
else
else
if
then
if
then
else
else
Sample (not your requirement)
Hi @jwi1 ,
Choose Add Column – Custom Column, the custom column formula is:
if [event_type_gkey]=241
then
if [event_type_gkey_previous] = 243
then [placed_time_previous]
else "0"
else
if [event_type_gkey] =240
then
if [event_type_gkey_previous] =242
then [event_type_gkey_previous]
else "0"
else "0"
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @jwi1 ,
Choose Add Column – Custom Column, the custom column formula is:
if [event_type_gkey]=241
then
if [event_type_gkey_previous] = 243
then [placed_time_previous]
else "0"
else
if [event_type_gkey] =240
then
if [event_type_gkey_previous] =242
then [event_type_gkey_previous]
else "0"
else "0"
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thanks a lot all!
problem solved,
John
I agree with @HotChilli
Add custom column and in the custom column formula use; make sure if then else is in lower case (it will show blue color). nested lines is more of readability
if ...
then
if
then
else
else
if
then
if
then
else
else
Sample (not your requirement)
You'll want to add a custom column and write a reasonably complex if.. then.. else statement to cope with the different cases. Looks like it's just a matter of working through it. Is that enough to help you progress?
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 |
---|---|
112 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |