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
Anonymous
Not applicable

Limiting a visual till current selection

I have a slicer which is coming from Calendar table it has dates from 01-01-2015 to 12-31-2060, i have limited sllicer to year 2020 & 2021 with 

var loaddate = max('Brand Attributes'[insert_timestamp])
return
IF((SELECTEDVALUE('Time Dimension'[Date].[Year])=YEAR(TODAY())&& SELECTEDVALUE('Time Dimension'[Date].[Date]) <=loaddate)

|| SELECTEDVALUE('Time Dimension'[Date].[Year])=YEAR(TODAY())-1,1)
 
in this 'Brand Attributes'[insert_timestamp] is the column on which data is being updated. Along with this we have prev_year_sales & current_year_sales columns. I want to achieve if we have whole 2021 is selected (current month +2 months)
 
raghavdevsingh_0-1624951158981.png

Filter passed on above visual is 

CurrentYear_Chart =
var loaddate=MAX('Brand Attributes'[insert_timestamp])
return IF(AND(Year('Time Dimension'[Date])=YEAR(TODAY()),'Time Dimension'[Date]<=loaddate) ||AND(MONTH('Time Dimension'[Date])<=MONTH(TODAY())+2,MONTH('Time Dimension'[Date])>MONTH(TODAY())) || Year('Time Dimension'[Date])=YEAR(TODAY())-1,1)
 
It is a calculated column on Date Table.

If I deselect June (Current Month) then it should show data only till May 2021 but when I deselect june It is showing like 

raghavdevsingh_1-1624951507632.png

 

But I want it to be till may only. I want to achieve it with Heirarchy slicer

raghavdevsingh_2-1624951586085.png

 

1 REPLY 1
Anonymous
Not applicable

@Anonymous 

 

Please get familiar first with how to properly work with dates and times in PBI: Standard time-related calculations – DAX Patterns

 

Then, you can make use of this hint: If a measure returns BLANK, it will not be shown in a visual. Also, you can filter a visual through the Filter Pane and make use of any measure you find useful.

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.