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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
SuryaK
Frequent Visitor

slicer

When I select Aug 17 in the filter than data of only Jun-17, July-17 and Aug-17 should be shown in the slicer graph

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @SuryaK ,

 

According to your description, you want to select a certain value in a slicer and then return the value of the day of the previous 3 months in the slicer. For this requirement, which we cannot achieve in one slicer, we need to use two tables and create two slicers.

 

Here is my test data: "Table"

Table = CALENDAR(DATE( 2022,1,1) ,DATE(2022,3,1))

Then we need to create a second date table based on the date column of this Table, and make sure that the date column of this new date table needs to contain the first three months of the table's dates.

Table 2 = var _max_date = MAX('Table'[Date])
var _min_date = MIN('Table'[Date])
var _first_date = EDATE(_min_date , -2)
return
CALENDAR(_first_date , _max_date)

Then, we create a measure.

Measure = var _slice = SELECTEDVALUE( 'Table'[Date])
var _t = {EDATE(_slice,-1),EDATE(_slice,-2),_slice}
return
IF(SELECTEDVALUE('Table 2'[Date]) in _t ,1,0)

Then we put 'Table'[Date] in slicer 1, then 'Table2'[Date] in slicer 2, and then we put our metric in slicer 2's " Filter on this visual" and then configure it as follows:

vtangjiemsft_0-1666863867520.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @SuryaK ,

 

According to your description, you want to select a certain value in a slicer and then return the value of the day of the previous 3 months in the slicer. For this requirement, which we cannot achieve in one slicer, we need to use two tables and create two slicers.

 

Here is my test data: "Table"

Table = CALENDAR(DATE( 2022,1,1) ,DATE(2022,3,1))

Then we need to create a second date table based on the date column of this Table, and make sure that the date column of this new date table needs to contain the first three months of the table's dates.

Table 2 = var _max_date = MAX('Table'[Date])
var _min_date = MIN('Table'[Date])
var _first_date = EDATE(_min_date , -2)
return
CALENDAR(_first_date , _max_date)

Then, we create a measure.

Measure = var _slice = SELECTEDVALUE( 'Table'[Date])
var _t = {EDATE(_slice,-1),EDATE(_slice,-2),_slice}
return
IF(SELECTEDVALUE('Table 2'[Date]) in _t ,1,0)

Then we put 'Table'[Date] in slicer 1, then 'Table2'[Date] in slicer 2, and then we put our metric in slicer 2's " Filter on this visual" and then configure it as follows:

vtangjiemsft_0-1666863867520.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

Thanks @ v-tangjie-msft

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.