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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors