Blog Post

Power BI Community Blog
1 MIN READ

Make a clock visual with DAX

V-lianl-msft's avatar
V-lianl-msft
Icon for Community Support rankCommunity Support
5 years ago

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.  

Published 5 years ago
Version 1.0

2 Comments

  • Thanks for posting this. Just for kicks I linked it to the Play axis slicer and it works great... Thanks again.

  • swaralig's avatar
    swaralig
    Regular Visitor

    I am having BOT Id's, Process names, Process run time..
    My requirement is i want to create a clock visual in such a way where for example if For BOT 1 i am having 10 processes which are running on different time...Like Process 1 is running between 1:30 Pm to 2:00 Pm...Process 2 is running between 4:00 Pm to 5:30 Pm...then in the clock this particular time slots should be shaded as light grey....

    i have total 6 BOTS for each bot i want to create different clock with same conditions and when i hover on the grey shaded part in the tooltip it should show me the process names which are running in that slot..

    Please help me with this