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

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

Reply
Anonymous
Not applicable

Date Slicer with DAX calculation

Hi,

 

i have a date table containg many dates (incremantaly).

 

i wish to create a culomn that will allow me to create a slicer with the current groups.

 

for the current month( MAR-2020) it will show "This Month"

 

for the FEB -2020 it will Show "Show Last Month"

 

for the 6 month before FEB -2020 show in the last 6 month before last month(FEB-2020)"

for the months : Jan-2020,Dec-2019,Nov-2019,Oct-2019 ,Sep-2019,Aug-2019 :in the last 6 month before last month(FEB-2020)"

 

see below example:

Date(from Date table)(DD-MM-YY)Month&Year(MM-YY)Group
1/3/2020Mar-20Current Month
1/2/2020Feb-20Last month
1/1/2020Jan-20In the last 6 Months
1/12/2019Dec-19In the last 6 Months
1/11/2019Nov-19In the last 6 Months
1/10/2019Oct-19In the last 6 Months
1/9/2019Sep-19In the last 6 Months
1/8/2019Aug-19In the last 6 Months
1/7/2019Jul-19Other months
1/6/2019Jun-19Other months
1/5/2019May-19Other months

 

 

 

thanks!

 

 

 

 

 

 

 

 

 

4 REPLIES 4
Anonymous
Not applicable

why do want like this column?

 

There is already feature "relative date" for date slicers where you can select today last N month/Year/Days.

 

Make your slicer as relative date slicer.

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

Anonymous
Not applicable

hi,

 

the reason i want is as a coulmn since the costumer want to have a slicer botton on the report that will able him to filter the page for each period

 

current month

previus month

 

last 6 months before previus month

 

thanks

 

 

Anonymous
Not applicable

one solution is here.

https://community.powerbi.com/t5/Desktop/Date-Selector-interaction-with-Date-Slicer/m-p/963412#M4616...

 

but when you mark you date slicer as relative it will allow your end user to select particular time span like last 6 months,today, this week.

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

 

Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

The below blog post explains how to achieve this with use of query editor, it returns 0 for the current month and -1 for previous and so on, later you can add a column converting numbers to text.

https://community.powerbi.com/t5/Community-Blog/Relative-Date-Dimension/ba-p/779039

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

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.