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.
Hello,
New to PowerBI, had some issues with custom column.
I'm trying to count rows which contains certain words (12 month / 1 year) and a certain condition from 2 seperate columns.
The Duration column contains many different string but with a similarity at the beggining with Capslock and without (12 months/ 12 Months or 1 year/ 1 Year).
Here is the code im using, no syntax errors, but also no results 😞 -
if [Event]="Transformation" and ([Duration] like "12 Month%" or [Duration] like "1 Year%") then 1 else null
This code isnt working since it only returns nulls.
I know where the issue is - like function as in sql and im trying to find it Powerbi's function.
Thanks!
Solved! Go to Solution.
@Anonymous , In power query
if [Event]="Transformation" and (Text.Contains([Duration] ,"12 Month%") or Text.Contains([Duration], "1 Year%")) then 1 else null
DAX
if ( [Event]="Transformation" && (CONTAINSSTRING([Duration] ,"12 Month%") || CONTAINSSTRING([Duration], "1 Year%")) , 1 , blank())
@Anonymous , In power query
if [Event]="Transformation" and (Text.Contains([Duration] ,"12 Month%") or Text.Contains([Duration], "1 Year%")) then 1 else null
DAX
if ( [Event]="Transformation" && (CONTAINSSTRING([Duration] ,"12 Month%") || CONTAINSSTRING([Duration], "1 Year%")) , 1 , blank())
Its working perfectly!
Thanks a lot!
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |