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
DivakarKrishnan
Helper II
Helper II

Default value assistance in DAX

Dear Team,

 

I have written following DAX to show our YTD closing balances in card visuals. When i am choosing months in slicer i am getting the values correctly. However, if i am not choosing any months in slicer, card visual is showing as "Blank".

 

 

DAX:

Closing Collection YTD = CALCULATE([Closing Balance], DATESYTD('Calendar'[Date]) )
 

I would like to populate current month (september balance) as the default one when no month choosen. How to achieve this in DAX. Please guide me.

 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@DivakarKrishnan ,when you do not choose any month in the slicer , the last date for datesytd is the end date of your calendar. So if you do not have future data in any of your tables. Stop your calendar at today.

otherwise, you have to choose a month or date

 

refer Power BI — YTD -FAQ
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@DivakarKrishnan ,when you do not choose any month in the slicer , the last date for datesytd is the end date of your calendar. So if you do not have future data in any of your tables. Stop your calendar at today.

otherwise, you have to choose a month or date

 

refer Power BI — YTD -FAQ
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you Amit.. This should be fine.

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!

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.