Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi Team,
I have below data, I want set "Flag" based on come columns condition.
For Flag one.
- If "Current Date" and "Load_date" same or not, If same date Group by "Route" & "City" & "SEQ NUM" and check "Truck_Assigned" X . If "Truck_Assigned" X then Flag is 1.
- If "Current Date" and "Load_date" same or not, If same date Group by "Route" & "City" & "SEQ NUM" and check "Truck_Assigned" X not assigned but unique value then Flag is 1.
-If "Current Date" and "Load_date" same or not, If same date Group by "Route" & "City" & "SEQ NUM" and check "Truck_Assigned" X not assigned but two value then set any one of row as Flag is 1.
| Route ID | Load_date | Route | City | SEQ NUM | Truck_Assigned | Current Date | Flag | |
| 1234 | July 30,2020 | USABOH | Lock | 1 | X | July 30,2020 | 1 | |
| 4567 | July 21,2020 | USFRES | FRE | 1 | X | July 30,2020 | 0 | |
| 7890 | July 30,2020 | USGA01 | WES | 1 | X | July 30,2020 | 1 | |
| 987 | July 30,2020 | USGA01 | VAL | 2 | July 30,2020 | 1 | ||
| 6543 | July 30,2020 | USMA01 | OLI BR | 1 | July 30,2020 | 0 | ||
| 3456 | July 30,2020 | USMA01 | OLI BR | 1 | July 30,2020 | 0 | ||
| 7888 | July 30,2020 | USMA01 | OLI BR | 1 | X | July 30,2020 | 1 | |
| 2134 | July 30,2020 | USMA01 | OLI BR | 1 | X | July 30,2020 | 1 | |
| 5490 | July 30,2020 | USTN01 | LAV | 2 | July 30,2020 | 1 | ||
| 5103 | July 30,2020 | USTN01 | LAV | 2 | July 30,2020 | 0 | ||
| 4309 | July 30,2020 | USTN01 | LAKE | 1 | July 30,2020 | 1 |
Hi , @Anonymous
Could you please tell me whether your problem has been solved?
If yes, you could accept the helpful answer as solution. You also could share your own solution here. For now, there is no content of description in the thread. If you still need help, please share more details to us.
Best Regards,
Community Support Team _ Eason
@Anonymous you can use switch functon like this
SWITCH ( TRUE(),
Table[Column1] = "ABC" && Table[Column2] = "XYZ" && Table[Column3] = 123, "Value 1",
Table[Column1] = "ABC" || ( Table[Column2] = "XYZ" && Table[Column3] = 123 ), "Value 2",
Table[Column1] = "ABC" || Table[Column2] = "XYZ" || Table[Column3] = 123, "Value3",
"Catch all"
)
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous to add more
&& -> Is used for and condition
|| -> is used for or condition
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi,
Thanks for reply.
I Column value won't same always . We can't use switch condition.
Logic is , On below record. I want display only lost two row data. Because It's assigned "X" and Don't want display which is no assigned X.
| 6543 | July 30,2020 | USMA01 | OLI BR | 1 | July 30,2020 | |
| 3456 | July 30,2020 | USMA01 | OLI BR | 1 | July 30,2020 | |
| 7888 | July 30,2020 | USMA01 | OLI BR | 1 | X | July 30,2020 |
| 2134 | July 30,2020 | USMA01 | OLI BR | 1 | X | July 30,2020 |
One more logic, on below record. There no truck assigned. But For each combination I need consider one row as orginal record.
| 5490 | July 30,2020 | USTN01 | LAV | 2 | July 30,2020 | |
| 5103 | July 30,2020 | USTN01 | LAV | 2 | July 30,2020 | |
| 4309 | July 30,2020 | USTN01 | LAKE | 1 | July 30,2020 |
Hi, @Anonymous
I'm a little confused about these two sets :
6543 July 30,2020 USMA01 OLI BR 1 July 30,2020 0
3456 July 30,2020 USMA01 OLI BR 1 July 30,2020 05490 July 30,2020 USTN01 LAV 2 July 30,2020 1
5103 July 30,2020 USTN01 LAV 2 July 30,2020 0Why the result of the first set is 0 and 0, and the result of the second set is 1 and 0?
Can you share more details?
Best Regards,
Community Support Team _ Eason
@Anonymous not sure I followed it completely, what you mean column name will not be the same?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
SWITCH ( TRUE(),
Table[Column1] = "ABC" && Table[Column2] = "XYZ" && Table[Column3] = 123, "Value 1",
Table[Column1] = "ABC" || ( Table[Column2] = "XYZ" && Table[Column3] = 123 ), "Value 2",
Table[Column1] = "ABC" || Table[Column2] = "XYZ" || Table[Column3] = 123, "Value3",
"Catch all"
)
In Column1 ="ABC" & Column2"XYZ" & Column3=123 , You want me to give Route & City & SEQ number value right ? ..
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.