Forum Discussion
Time in slicer
- Anonymous1 year ago
Thanks for following up. If displaying the time with a dot or colon (like 08:30 or 08.30) inside the slicer is a must, here's the best workaround given Power BI's current limitations:
You can still use the TimeInMinutes (or a decimal field) for the slicer logic, but pair it with a display column that shows the time in the format you need. Here's how you can do it:
TimeDecimal = HOUR([YourTimeColumn]) + MINUTE([YourTimeColumn]) / 60 TimeLabel = FORMAT([YourTimeColumn], "HH:mm")If your locale forces a comma in TimeDecimal, and you just need the label to show a dot or colon, create a custom label column:
TimeLabelDot = SUBSTITUTE(TimeLabel, ":", ".")Then use a custom slicer visual (like Smart Filter by OKViz or HierarchySlicer) that lets you show labels but filter using the underlying value.
Power BI's built-in slicer doesn’t support formatted display with separate logic, so using a custom visual is the most flexible option here.
Best Regards,
Hammad.
- In your Time Dimension table, create a new calculated column and Use this TimeDecimal field in the Between slicer.
TimeDecimal = HOUR([YourTimeColumn]) + MINUTE([YourTimeColumn]) / 60
- Display your X-axis in visuals using the original formatted Time column.
- You can optionally format the TimeDecimal to look like time using a calculated display column:
TimeLabel = FORMAT([YourTimeColumn], "HH:mm")
Thank you. Slicer still behaves weird
I tried to use decimal number, but locale-settings turns dot to comma. Changing locale/language in PBI service or browser is not an option. I can only do changes in PowerBI Desktop or in Tabular Model.
Is it possible to force dot to decimal numbers (instead of comma)?