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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
menphis21
Helper IV
Helper IV

Manage a data from a calendar in a slicer

Hi,

 

I created a calendar table in Dax with this formula. When i check my table, its fine i obtain all my dates.

But i but the filed date inside a slicer, it shows me date until 31 december 2023 whereas i have a table that finish at 06/01/2023.

Someone can help me ?

 

Thank youDate pbm1.PNGDate slicer pbm 2.PNG

4 REPLIES 4
menphis21
Helper IV
Helper IV

thank you @amitchandak 

But i need to create that in a table separately because i am also using in the application function like Samelastperiod() .
If i am not using Date hierarchy theses functions didnt work for me.
Also i need to connect few tables to that Calendar table. 

So how can i do ? I need to create a new table in Power query ? or in DAX but in my table created by the calendar function (Where i cannot add another column as far as i know) ?

 

Thank you for your help

amitchandak
Super User
Super User

@menphis21 , If you are using date hierarchy, do not use that. Create column like month, year etc in date table and use those

 

Calendar = Addcolumns(calendar(date(2021,01,01), Max(LastUpdates[Last Update Date])  ), "Month no" , month([date])
, "Year", year([date])
, "Month Year", format([date],"mmm-yyyy")
, "Month year sort", year([date])*100 + month([date])
, "Qtr Year", format([date],"yyyy-\QQ")
, "Qtr", quarter([date])
, "Month",FORMAT([Date],"mmmm")
, "Month sort", month([DAte])
, "Is Today" ,if([Date]=TODAY(),"Today",[Date]&"")
,"Day of Year" , datediff(date(year([DAte]),1,1), [Date], day)+1
, "Month Type", Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY") )
,"Year Type" , Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)
)

 

 

Sort the date in date calendar and check what is max date.

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

HI @amitchandak ,

 

Thank you. But if i am not using the hierarchy date,  function like Sameperiodlastyear didn't work.

Do you have a solution ?

HI @amitchandak ,

 

Can you help me please ?

Also, your solution didnt solve the problem.

 

Thank you

 

@Idrissshatila @lbendlin 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.