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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jasgun01
Frequent Visitor

dynamic date filter

Hi,

 

I have a Fact table "Reporting AllPolicies(Yellow Table) and I want to filter that base on that based on the users selection on the slicer "Accounting Date (Green Drop Down).

 

I have added a measure on the Yellow table to get the selected value from the slicer ("_SelectedDate")

 

Then I have added a new column and thought a basic if statement would allow me to filter the results.

See formula "_InForce" = 

if('Reporting AllPolicies'[PolicyInceptionDate] <= [_SelectedDate],"Y","N")
 
However, see highlighted red items that I would expect the results to be "Y".
 
PBI_Dates.png
 
 
Can someone assist on what I'm doing wrong or if there's another way to do it?
 
Thanks
 
Jason
1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @jasgun01 

Try MAX(PolicyInceptionDate) it should give a the right result, measure will need some sort of aggregation as it does not have a row context.

 

Hope this helps 

Mariusz

View solution in original post

3 REPLIES 3
Mariusz
Community Champion
Community Champion

HI @jasgun01 

You need to use Measure instad of a Column

Mariusz

Thanks for responding @Mariusz 

I thought I would try a measure, but as part of the if statement I couldn't choose the field "PolicyInceptionDate"

 

PBI_Dates2.png

Mariusz
Community Champion
Community Champion

Hi @jasgun01 

Try MAX(PolicyInceptionDate) it should give a the right result, measure will need some sort of aggregation as it does not have a row context.

 

Hope this helps 

Mariusz

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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