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
amtrakrob
Frequent Visitor

Records that are true for more then one IF statement.

Hello All..
I have an Exeration Date field.  I'm trying to create a filter that has 3 options 

Due within 30 days, Due within 60 days, Due within 90 days, Due within 120 days, Due within 180 days, Due within 365 days , Expired 
My problem... 
I can do and if statemet that does 1-30 then 31 to 60, then 61-90, etc,  But what I need is an if statement that  includes all records under the number.  Example if I select the Due Within 120 days option, it should should show the records due within 30,60, and 90 also. 
thanks in advance.

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a table like

Slicer Dates =
SELECTCOLUMNS (
    UNION (
        GENERATE ( { "Due within 30 days" }, CALENDAR ( TODAY (), TODAY () + 30 ) ),
        GENERATE ( { "Due within 60 days" }, CALENDAR ( TODAY (), TODAY () + 60 ) ),
        GENERATE ( { "Due within 90 days" }, CALENDAR ( TODAY (), TODAY () + 90 ) ),
        GENERATE ( { "Due within 120 days" }, CALENDAR ( TODAY (), TODAY () + 120 ) )
    ),
    "Range", [Value],
    "Date", [Date]
)

Create a many-to-many relationship from this new table to your fact table but make it single direction so that the slicer table filters your fact table. Use the range column in your slicer and it will filter to those dates which fall in the appropriate range.

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You could create a table like

Slicer Dates =
SELECTCOLUMNS (
    UNION (
        GENERATE ( { "Due within 30 days" }, CALENDAR ( TODAY (), TODAY () + 30 ) ),
        GENERATE ( { "Due within 60 days" }, CALENDAR ( TODAY (), TODAY () + 60 ) ),
        GENERATE ( { "Due within 90 days" }, CALENDAR ( TODAY (), TODAY () + 90 ) ),
        GENERATE ( { "Due within 120 days" }, CALENDAR ( TODAY (), TODAY () + 120 ) )
    ),
    "Range", [Value],
    "Date", [Date]
)

Create a many-to-many relationship from this new table to your fact table but make it single direction so that the slicer table filters your fact table. Use the range column in your slicer and it will filter to those dates which fall in the appropriate range.

Thank you very much!!!
That worked

 

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.