Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
wujunmin
Advocate III
Advocate III

Custom Calendar Visual by DAX

wujunmin_0-1638087181817.png

First, creat a calendar table:

Calendar = 
ADDCOLUMNS(CALENDAR(DATE(2021,1,1),DATE(2021,12,31)),
    "Month",MONTH([Date]),
    "Day",DAY([Date]),
    "DDD",FORMAT([Date],"DDD"),
    "WeekDay",WEEKDAY([Date],2),
    "WeekNum",WEEKNUM([Date],2) 
)

Then, creat a svg measure, mark it as  image url: 

SVG_DAY = 
"data:image/svg+xml;utf8,"&"
<svg xmlns='http://www.w3.org/2000/svg' height='100' width='100'>"&
    IF(SELECTEDVALUE('Calendar'[Date])=TODAY(),"<circle cx='50' cy='50' r='40' fill='Tomato'/>",BLANK())&"
    <text x='50' y='50' font-size='30' text-anchor='middle' dominant-baseline='middle' fill='"&
        IF(SELECTEDVALUE('Calendar'[Date])=TODAY(),"White",IF(SELECTEDVALUE('Calendar'[WeekDay])>=6,"Grey","Black"))&"'>"&SELECTEDVALUE('Calendar'[Day])&"
    </text>
</svg> " 

Finally, a matrix:

wujunmin_1-1638087435873.png

 

0 REPLIES 0

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors