Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
I have a query which works partially:
Solved! Go to Solution.
@Kreg ,
Here is a slight modification:
Accepted/Failed = SWITCH(
TRUE(),
LEFT( [Type],8 ) = "https://", "Accepted",
LEFT( [Type], 1 ) IN {"1","2","3","4","5","6","7","8","9","0"}, "Accepted",
"Failed" )
Type Accepted/Failed
| https://tesla.com/345345 | Accepted |
| 345345 | Accepted |
| - | Failed |
| Not Applicable | Failed |
The limitation with this code is that it assumes if the first character is a digit, then the entire value is numeric. If your entries will consist of both numbers and letters, then further adjustments will have to be made.
Regards,
@Kreg ,
Looks like there are a few issues with your syntax. Please try this:
Accepted/Failed = SWITCH(
TRUE(),
LEFT( [Type],8) = "https://", "Accepted",
ISNUMBER( VALUE([Type] )) = TRUE(), "Accepted",
"Failed" )
I trust I interpreted your question correctly.
Regards,
You interpreted it very correctly but I missed that in some rows might be some string provided by the user like "-", "Not Applicable", etc. and when I used your query I got message:
"Cannot convert value '-' of type Text to type Number."
So lets say that everything those kind of input must be treated as Failed.
@Kreg ,
Here is a slight modification:
Accepted/Failed = SWITCH(
TRUE(),
LEFT( [Type],8 ) = "https://", "Accepted",
LEFT( [Type], 1 ) IN {"1","2","3","4","5","6","7","8","9","0"}, "Accepted",
"Failed" )
Type Accepted/Failed
| https://tesla.com/345345 | Accepted |
| 345345 | Accepted |
| - | Failed |
| Not Applicable | Failed |
The limitation with this code is that it assumes if the first character is a digit, then the entire value is numeric. If your entries will consist of both numbers and letters, then further adjustments will have to be made.
Regards,
Thats IN really works and looks very smart. Thanks for that. It works for me.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 40 | |
| 36 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 38 | |
| 34 | |
| 23 |