The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I need to put a formula in both m and dax language that if a field starts with * I should create a column with "open", if it doesn't start with * I should have "closed", how can I do?
Thanks
field | column to create |
*abcd | open |
abcd | closed |
Solved! Go to Solution.
Hi,
in power query you can create a custom column with the formula:
if Text.StartsWith([Column1],"*") then "Open" else "Closed"
full m code:
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Text.StartsWith([Column1],"*") then "Open" else "Closed")
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Hi,
in power query you can create a custom column with the formula:
if Text.StartsWith([Column1],"*") then "Open" else "Closed"
full m code:
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Text.StartsWith([Column1],"*") then "Open" else "Closed")
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
thanks!
Additionally in DAX calculated column:
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
79 | |
78 | |
44 | |
38 |
User | Count |
---|---|
150 | |
116 | |
68 | |
64 | |
58 |