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.
I have a column of Total Duration in seconds and I am trying to create a column called, "Label" which I want to turn into a Dropdown Slicer. I get the error code of, "Cannot conver value 'Less than 300" of type Text to type Integer
Total Duration DropDown =
SWITCH(
TRUE(),
[Total Duration] <= 300, "Less than 300",
[Total Duration] <= 400, "Less than 400",
[Total Duration] <= 500, "Less than 500"
)
Total Duration | Label |
99 | Less than 100 seconds |
7 | Less than 100 seconds |
523 | Less than 600 seconds |
388 | Less than 400 seconds |
Solved! Go to Solution.
@reportuser , This code seems fine, hope Total Duration is a column and number type
Can you a sample pbix after removing sensitive data.
@reportuser , This code seems fine, hope Total Duration is a column and number type
Can you a sample pbix after removing sensitive data.
@amitchandak, The label is a column and it was whole number which caused the error. Once I changed the Label Column to Data Type, "Text" the formula worked.
Your question actually provided the solution. Thank you 🙂
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |