cancel
Showing results for
Did you mean:

## Make a clock visual with DAX

Scenario:

I'm going to share with you a little trick, just make a clock visual with DAX.

The visual looks like this:

Operation

The operation steps are as follows:

1. Create a new table as the hour slicer of clock visual.

clock = GENERATESERIES(1, 24, 1)

2. The most important is to use the characteristics of UNICHAR function to dynamically display different vision

clock =

var hours = SELECTEDVALUE(clock[Hour],1)

var _12h = IF(hours>12,hours-12,hours)

return UNICHAR(128335+_12h)

3. Drag this measure into card visual and then will show a clock visual.

Unicode table used

Here is the Unicode of the clock. We can change the visual of the clock by changing the value of the Unicode.

 Clock Symbol Clock Name Decimal 🕐 Clock Face One Oclock 128336; 🕑 Clock Face Two Oclock 128337; 🕒 Clock Face Three Oclock 128338; 🕓 Clock Face Four Oclock 128339; 🕔 Clock Face Five Oclock 128340; 🕕 Clock Face Six Oclock 128341; 🕖 Clock Face Seven Oclock 128342; 🕗 Clock Face Eight Oclock 128343; 🕘 Clock Face Nine Oclock 128344; 🕙 Clock Face Ten Oclock 128345; 🕚 Clock Face Eleven Oclock 128346; 🕛 Clock Face Twelve Oclock 128347; 🕜 Clock Face One-thirty 128348; 🕝 Clock Face Two-thirty 128349; 🕞 Clock Face Three-thirty 128350; 🕟 Clock Face Four-thirty 128351; 🕠 Clock Face Five-thirty 128352; 🕡 Clock Face Six-thirty 128353;

Tips

You can also use the UNICHAR function and other Unicode to create the visual you want.

Top Kudoed Posts
Latest Articles
Archives