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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
ahmadhammoud
Regular Visitor

Dynamic Filter

  1. Dears, 
  2. i have a table with multi Date for example:
  3. ID, Arrive Date, Charge Date, Dischare Date
  4. and i have a date slicer from 2020 to 2024 
    i need to filter the table have the column mentioned above by a drop down list 
  5. so if selected value from the list is Arrive then filter the table where Arrive Date between 
  6. ---> if slicer is filtered so filter the table between the slicer min and max dates 
  7. ---> if slicer is not filter so filter the table between last start and end month 
    the below DAX  not working with error "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

    FIN_List_Posting_Date_Filter =
    VAR DateList = SELECTEDVALUE(My_Report_Date[Report],"Posting Date")
    VAR SlicerMIN = MIN(DateTimeTable[DateTime])
    VAR SlicerMAX = MAX(DateTimeTable[DateTime])
    /*VAR StartDateMIN= IF(NOT(ISFILTERED(My_Report_Date[Report])),[StartDate])
    VAR StartDateMAX= IF(NOT(ISFILTERED(My_Report_Date[Report])),[EndDate])*/
    VAR
    PostedFilter = SWITCH( TRUE(),
    DateList ="Posting Date" , IF(ISFILTERED(DateTimeTable[DateTime]),
    CALCULATETABLE(
    FILTER(Charges,
    Charges[POSTED_DT_TM] >= SlicerMIN &&
    Charges[POSTED_DT_TM] <= SlicerMAX + TIME(0, 59, 59))),
    CALCULATETABLE(
    FILTER(Charges,
    Charges[POSTED_DT_TM] >= [StartDate] &&
    Charges[POSTED_DT_TM] <= [EndDate]+1))))


    RETURN PostedFilter



1 REPLY 1
lbendlin
Super User
Super User

Use a disconnected table for your slicer, and a measure filter for the visual.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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