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
krjen
Regular Visitor

Period slicer using calculated columns

I am pretty new at Power BI, but I can't wrap my head around this problem: 

In my date table I have these 4 columns: 

krjen_0-1729235451323.png

These columns returns true/false values if the date is in "the last 12 months" or "last 16 weeks", etc.  

The problem is this: 
I want to create a slicer with "Year", "Quarter", "Week" and "Month" that shows the given period in my visuals. 

Any idea on what I should do next? 
When I choose "year", it should return the last 3 years. 

1 ACCEPTED SOLUTION
AlexTheGreat
Resolver II
Resolver II

You can use the built-in slicer for creating dynamic date ranges like "last # day" or "last # month" etc.

Follow these steps: make a slicer > Slicer settings > style: Relative Date

AlexTheGreat_0-1729237226592.png

 



View solution in original post

3 REPLIES 3
krjen
Regular Visitor

Thanks for solutions. But it is not exactly what I need. 
It wont change the values on x axis (showing year when I filter on months). 

I`ve created a Dynamic Date table: 

krjen_1-1729240341009.png

 

 

Is there any way I can use the "Dyanamic Date" column as a slicer, and connect the "Year" row to the
"(true/false) Last 3 Years" column in date table? 

Example: 
If I press "Year" It should return the last three years (they have value "True" in 'Date'[(true/false) Last 3 year]).

 

krjen_3-1729240695009.png

 

 




AlexTheGreat
Resolver II
Resolver II

You can use the built-in slicer for creating dynamic date ranges like "last # day" or "last # month" etc.

Follow these steps: make a slicer > Slicer settings > style: Relative Date

AlexTheGreat_0-1729237226592.png

 



ryan_mayu
Super User
Super User

you can try to create a measure.

 

= if(selectedvalue(column)="Year" && max((true/false)Last 3 years)=true(), 1)

 

then add this measure to visual filter and set to 1.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.