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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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