We'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 All,
I have a column that contains (formated as time) minutes. I am trying to writie an If statement like this: If (column that contains minutes) is less than 30 minutes, then "YES" otherwise "NO". I get this error after trying to write the formula "DAX comparison operations do not support comparing values of type DATE with values of type TEXT.
Any ideas on how best to write this formula??
Thanks
Solved! Go to Solution.
Below should help to convert hour to minutes and compare in IF statement
IF( HOUR(Table1[Column1]) * 60 + MINUTE (Table1[Column1]) <=30,"Yes", "No")
Please provide a sample of how your minutes column data is represented and how you are representing 30 mins in the formula
The minutes column looks like this example 0:14,1:05, etc.
This is how I tried writing the formula: If(Column name<=("0:30"), "Yes", "No")).
Hope this explains it clearly.
Thanks
Below should help to convert hour to minutes and compare in IF statement
IF( HOUR(Table1[Column1]) * 60 + MINUTE (Table1[Column1]) <=30,"Yes", "No")
Hi,
I just used your suggested formula and it worked like magic.
Many thanks for the quick solution.
Regards
Pls mark this as a solution
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 |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 17 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 62 | |
| 38 | |
| 34 | |
| 22 |