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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ramanar
New Member

Implementing -Select with between on Model - Based on Slicer Date Selection

***Need help with how to pass Date based on Slicer calculated on a date table at the report level to calculate the new table at the model level .***

 

I am trying to use DAX:

To derive a table from an existing table (DimMembers) with all columns.

Where the date selected in a slicer is falling between DimMembers.StDate and DimMembers,EndDate.

 

MemberID

Name 

Area

StDate

EndDate

2

Ram

AZ

05-01-2019

15-01-2019

2

Ram

CA

16-01-2019

27-01-2019

2

Ram

LA

28-01-2019

31-12-2099

3

Shyam

CA

02-01-2019

16-01-2019

3

Shyam

AZ

17-01-2019

25-01-2019

3

Shyam

LA

26-01-2019

31-12-2099

 

Tab 2: sampleDate

asofdate

25-12-2018

31-01-2019

 

For Example if the slicer date is 31-01-2019 then, resultant derived table should have:

Name 

Area

StDate

EndDate

Ram

LA

28-01-2019

31-12-2099

Shyam

LA

26-01-2019

31-12-2099

--------

Option Tried:

In the reporting layer we add a filer on our sampleDate table
Calculate the max(asofdate) in a variable
Derive the tabe as derivedTable = (VAR ASOFDATEMAX=MAX(asofmaxTable[asofdate]) RETURN CALCULATETABLE(DimMembers,FILTER(DimMembers,DimMembers[StDate]>ASOFDATEMAX)))
 
Expectation Vs Actual Behaviour: 
  • MAXASOFDATE is calculated with reort level filter. 
  • However, in the current method, we were always getting the max pre-calculated irrespective of the filters at the report level. 
  • Tried creating a new derived table asofmaxTable = ADDCOLUMNS(sampleDate,"maxDate",max(sampleDate[asofdate]))  and used it  in the filter clause as below and that did not help.
          derivedTable = (VAR ASOFDATEMAX=MAX(asofmaxTable[asofdate])
                                      RETURN CALCULATETABLE(DimMembers,FILTER(DimMembers,ASOFDATEMAX<DimMembers[StDate])))
  • It is still ignoring the filter i have now on "table asofmaxTable " at the report level.
 
Need help with how to pass max of  asofdate based on filters on the date table at the report level to calculate the new table at the model level .
1 REPLY 1
sturlaws
Resident Rockstar
Resident Rockstar

Hi @ramanar 

 

calculated tables (and columns) can not be updated by slicers, they are populated at query time(when data is loaded into the model).

There is the option of parameters, but that might be of limited use in your case:
https://www.youtube.com/watch?v=iiNDq2VrZPY

https://www.youtube.com/watch?v=twBUmqVOGgg

 

Cheers,
Sturla

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.