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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
xti224
Regular Visitor

sort custom column

 
1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @xti224 

Try to create a measure like this:

isShow = 
var _selectedDate=SELECTEDVALUE(Date1[Date])
var _45=IF(SELECTEDVALUE(Table1[Date])<=_selectedDate&&SELECTEDVALUE(Table1[Date])>=_selectedDate-45,1,0)
return _45

And filter items with the measure equal to 1 in the filter pane

Result:

vangzhengmsft_2-1648175617956.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

4 REPLIES 4
v-angzheng-msft
Community Support
Community Support

Hi, @xti224 

Try to create a measure like this:

isShow = 
var _selectedDate=SELECTEDVALUE(Date1[Date])
var _45=IF(SELECTEDVALUE(Table1[Date])<=_selectedDate&&SELECTEDVALUE(Table1[Date])>=_selectedDate-45,1,0)
return _45

And filter items with the measure equal to 1 in the filter pane

Result:

vangzhengmsft_2-1648175617956.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

Anonymous
Not applicable

It sounds like what you want is in Table 1, you pick one date, then in some visual, you show results from Table 2 that fall within the time frame Table 1 Date -45 to Table 1 Date, right? Are you using this to filter? If so, this could fit your needs. You'd just filter to where the measure is 1. 

VAR Minus45 = maxx('table1' , dateadd('table1'[Date2],-45, DAY))
RETURN
IF (
    SELECTEDVALUE ( table2[Date1] ) <= MAX ( 'table1'[Date2] )
        && SELECTEDVALUE ( table2[Date1] ) >= Minus45 ,
    1,
    0
)



I need whatever the user selects for date1 (ex. 11/30/2021) to return the same date that is used on the visual  date2 and anything else in the last 45 days (return values ex. 10/15/2021 to 11/30/2021) but these are two separate table fields. and Yes date1 would be a dropdown list for the user to select a date

Anonymous
Not applicable

So I think what I wrote above would fit you needs, except that Date2 should be Date1

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.