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

Win a FREE 3 Day Ticket to FabCon Vienna. Apply now

Reply
TusharGaurav
Helper III
Helper III

How to filter data from 2 table based different date conditions while having only one date slicer?

Hi Experts,

 

I have 2 table having data as below:

Table1:

Order NumberOrder TypeTransaction DateModification DateInvoice NumberRevenue
12345OT121-Sep-2422-Sep-243423423413741.86
87863OT222-Sep-2423-Sep-24453421620
68469OT323-Sep-2428-Sep-2435243535900
553742OT424-Sep-2429-Sep-2445235251620

 

Table 2:

Order NumberOrder TypeModification DateItem NumberProduct codeGeography code
12345OT122-Sep-2441591074wqewq11
87863OT223-Sep-2441324274dcsac22
68469OT328-Sep-2441246418esafdsa23
553742OT429-Sep-2436594912fsdfd34

 

Both the tables are joined on Order Number.

 

I should have a "Date Slicer" where

for table 1,the date condition should be as below:

Date_Slicer_Date > ModificationDate and Date_Slicer_Date <= Transaction Date

for table 2,the date condition should be as below:

Date_Slicer_Date > ModificationDate 

So if date selected in the data slicer is 23-Sep-2024 then only record corresponding to order number 68469 should be displayed and my table visual should look like as below:

Order NumberOrder TypeTransaction DateModification DateInvoice NumberRevenueItem NumberProduct code
68469OT323-Sep-2428-Sep-243524353590041246418esafdsa2

 

Can you please suggest how to achieve this scenario using only one date slicer?

Thanks and Regards,

Tushar Gaurav

 

8 REPLIES 8
TusharGaurav
Helper III
Helper III

Hi Selva,

 

That is what I need to know.

The business requirement is as below:

I should have a "Date Slicer" where

for table 1,the date condition should be as below:

Date_Slicer_Date > ModificationDate and Date_Slicer_Date <= Transaction Date

for table 2,the date condition should be as below:

Date_Slicer_Date > ModificationDate 

In the date slicer I am planning to use "Modification Date"

@TusharGaurav 

 

I recommend you to have another table which can call your Date table and the slicer on the dashboard should be from this table. to generate the dates you can create a table, insert the minimum date you need, go to transform data, click on custom column and define a new column using following formula: ( keep in mind that 1000 is number of days you need to have following the start date) and Call this table DimDate

 

List.Dates ([Start] , 1000 , #duration( 1, 0, 0, 0))

 

and then click on the generated column and select expand to new row. you also can delete other columns.

SelvaSalimi_0-1727371068252.png

 

after that using this measure for first table:

measure 1 := if ( selectedvalue ('Dimdate' [Dates]) > 'table 1' ModificationDate && selectedvalue ('Dimdate' [Dates]) <= 'table 1' Transaction Date , 1 , 0 )

 

write another measure for table 2 as follows:

 

measure 2 := if ( selectedvalue ('Dimdate' [Dates]) > 'table 2' ModificationDate , 1 , 0 )

 

** delete the relation between your tables**

 

add this two measure in visual level filter of each table and set it to 1.

 

If this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly. 

Hi Selva,

 

I have tried the steps but its not working for me.

I am sharing the .pbix file.

Can you please check if you have bandwidth.

test.pbix

 

Thanks and Regards,

Tushar Gaurav

you should update your first measure as follows:

 

measure 1 = if ( selectedvalue ('Dimdate' [Dates]) <SELECTEDVALUE('table 1'[Modification Date]) && selectedvalue ('Dimdate' [Dates]) >= SELECTEDVALUE('table 1'[Transaction Date]) , 1 , 0 )
 
and what I still couldn't understand is that, did you want to visualize them in one table or two tables? if one, which columns or information did you want to add this visual from table 2?!

Hi Selva,

 

Thanks for your response.

I want the information in 1 table visual.

I should have the following row:

Order NumberOrder TypeTransaction DateModification DateInvoice NumberRevenueItem NumberProduct code
68469OT323-Sep-2428-Sep-243524353590041246418esafdsa2

 

Thanks and Regards,

Tushar

Selva-Salimi
Super User
Super User

@TusharGaurav 

 

You can have third table (Dim Date) and select slicer from thsi table.

 

or the other solution is not to connet these two tables together and just using a measure ( find selected values of table 1 in table2 and use if to be able to filter them in visual level)

 

If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly. 

Hi Selva,

 

Thanks for your response.

Unfortunately I am not able to understand your suggestion.

Can you please be a little bit more elaborative using the sample data that I shared.

 

Thanks and Regards,

Tushar Gaurav

@TusharGaurav 

 

Would you please clarify how you define condition of your slicer and also from which table have you choosed your date slicer?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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