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
winnieymh
Regular Visitor

How to filter 2 columns in one table using one slicer?

Hi, 

I have 1 table contains 2 different date column and one amount column. I want to create a measure to calculate the sum of amount for both date column's date before selected date. 

Let's see the example below:

For I want to sum up the amount for both date column less than the select datetime (using slicer created by calendar table to select date):

winnieymh_0-1627567803491.pngwinnieymh_1-1627567821551.png

 

1 ACCEPTED SOLUTION
dedelman_clng
Community Champion
Community Champion

Hi @winnieymh  - try something like this:

Measure1 =
VAR __Dt =
    SELECTEDVALUE ( [Date from Slicer] )
RETURN
    CALCULATE ( SUM ( Record[Amount] ), Calendar[Date] < __Dt )
        + CALCULATE (
            SUM ( Record[Amount] ),
            Calendar[Date] < __Dt,
            USERELATIONSHIP ( Record[Date2], Calendar[Date] )
        )

 

Hope this helps

David

View solution in original post

2 REPLIES 2
dedelman_clng
Community Champion
Community Champion

Hi @winnieymh  - try something like this:

Measure1 =
VAR __Dt =
    SELECTEDVALUE ( [Date from Slicer] )
RETURN
    CALCULATE ( SUM ( Record[Amount] ), Calendar[Date] < __Dt )
        + CALCULATE (
            SUM ( Record[Amount] ),
            Calendar[Date] < __Dt,
            USERELATIONSHIP ( Record[Date2], Calendar[Date] )
        )

 

Hope this helps

David

Thank you so much, it's a very good suggestion!!

 

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.