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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
aatish178
Helper IV
Helper IV

Table visual should dynamically respond to slicer selection

Hi All, I am new to power bi., and I am in really need of your help on my below query., Plz have a look and help if possible.

I have 2 tables(with no active direct relationship)., shown below:

Table1:

DateForFiltering

2024-01-01

2022-05-26

2022-05-25

2021-12-13

2021-10-01

The "Single Select" option is enabled on above field

Table2:(It has different versions of product., once one version closes., the next version will get started immediatly on next day)

ProductNo StoreID    ValidFrom           ValidTo                Qty

257298        ST1         2020-06-05     2021-11-29            2369

257298        ST1         2021-11-30     2021-12-12            2370

257298        ST1         2021-12-13     2022-05-25            2433

257298        ST1         2022-05-25     9999-12-31            2311

Here, for each ProductNo and StoreID Unique combinations, I have to find out lates product based on Max of ValidTo Date and in addition to that this table2 should only show data where ValidFrom date is <=  selectedvalue of Table1 DateForFiltering so that if user changes the date from table1 field slicer., the table visual from table 2 should filter accordingly.

I have achieved this by using below expression

Latest version = var maxdate=MAX(Table1[DateForFiltering])
var ValidFrom= FILTER(ALLEXCEPT('Table2','Table2'[ProductNo],'Table2'[StoreID]),'Table2'[ValidFrom]<=maxdate)
var result=
CALCULATE(max('Table2'[ValidTo]),ValidFrom)
RETURN
if(MAX('Table2'[ValidTo])=result,1,BLANK())

 

Now the main problem coming when user selects some lesser date from "ValidFrom" Slicer.

My Expectation is, even if user selects multiple less dates from "ValidFrom" Slicer, the latest version should get calculate based on the selected values of the slicer. Below are the sss FYR

aatish178_0-1719326919406.png

In this without selecting any validfrom date I am getting correct output

 

Screenshot2: With Issue

aatish178_1-1719327005847.png

Here I have selected 2 dates from validfrom slicer., these dates are fulfilling the criteria of ValidFrom<=SelectedValue(DateForFiltering)

Hence in All version we have 2 rows., and latest version should show the 1st row with max of validTo(2022-05-25) , but the table visual is showing blank result.

 

Someone plz help me to bring the result in latest version table?!.. Thanks in advance 🙂

@Ashish_Mathur @quantumudit @quantumudit1 @v-huijiey-msft @gmsamborn @v-jialongy-msft @v-kaiyue-msft 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@aatish178 , Change valid from

var ValidFrom= FILTER(allselected('Table2'),'Table2'[Item No] = max('Table2'[Item No]) && 'Table2'[RU] = max('Table2'[RU]) && 'Table2'[ValidFrom]<=maxdate)

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@aatish178 , Change valid from

var ValidFrom= FILTER(allselected('Table2'),'Table2'[Item No] = max('Table2'[Item No]) && 'Table2'[RU] = max('Table2'[RU]) && 'Table2'[ValidFrom]<=maxdate)

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

Wow Amit, the solution is working perfectly...I am really very very thankful to you...🙏 It has solved a big problem of mine

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors