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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ewelinag17
Frequent Visitor

Two filters for one column, filter independence.

Dear,

I have a proble.

I have a table.

ewelinag17_0-1598623286188.png

I want to create a report that will count the number of loans from the selected period and divide by the number of loans from the second selected range. One line is one loan. I want to report two filters with date selection and displayed result. I don't know how to make these two filters independent from each other. How to get it? Need I to create a new table? Can I create a measure? If so, what will it look like?

ewelinag17_1-1598623369468.png

Thank you in advance for your help.

best regards

2 ACCEPTED SOLUTIONS
AntrikshSharma
Community Champion
Community Champion

@ewelinag17  You will have to create duplicated date tables that are disconnected from the model, then use columns from these table in the slicers and then use it for filtering the dates in the table that is connected to the rest of the Model. here is an example.

 

=
VAR DisMinDate =
    CALCULATE (
        MIN ( DisconnectedDates[Dates] ),
        ALLSELECTED ( DisconnectedDates[Dates] )
    )      -- Min Date from the slicer which is using column from disconnected dates table
VAR DisMaxDate =
    CALCULATE (
        MAX ( DisconnectedDates[Dates] ),
        ALLSELECTED ( DisconnectedDates[Dates] )
    )      -- Max Date from the slicer which is using column from disconnected dates table
VAR FilterDates =
    FILTER ( ALL ( Dates ), Dates[Date] >= DisMinDate && Dates[Date] <= DisMaxDate ) 
VAR Result =
    CALCULATE ( [Measure], FilterDates )
RETURN
    Result

 

 

View solution in original post

amitchandak
Super User
Super User

2 REPLIES 2
amitchandak
Super User
Super User

@ewelinag17 , refer my blog on using two date slicers and how to compare data across those

https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

AntrikshSharma
Community Champion
Community Champion

@ewelinag17  You will have to create duplicated date tables that are disconnected from the model, then use columns from these table in the slicers and then use it for filtering the dates in the table that is connected to the rest of the Model. here is an example.

 

=
VAR DisMinDate =
    CALCULATE (
        MIN ( DisconnectedDates[Dates] ),
        ALLSELECTED ( DisconnectedDates[Dates] )
    )      -- Min Date from the slicer which is using column from disconnected dates table
VAR DisMaxDate =
    CALCULATE (
        MAX ( DisconnectedDates[Dates] ),
        ALLSELECTED ( DisconnectedDates[Dates] )
    )      -- Max Date from the slicer which is using column from disconnected dates table
VAR FilterDates =
    FILTER ( ALL ( Dates ), Dates[Date] >= DisMinDate && Dates[Date] <= DisMaxDate ) 
VAR Result =
    CALCULATE ( [Measure], FilterDates )
RETURN
    Result

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors