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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PowerVisualBI
Helper I
Helper I

How to filter two different dates in two different tables in one slicer

I want to filter [out_of_stock].[qty] and [normal price].[price] by using 2 different dates in each table.
The date I want to use:
1. [normal price].[update_at]
2. [out_of_stock].[created_at]

Is it possible if I only use one filter with the two date inputs above, but it directly affects two values, namely [out_of_stock].[qty] and [normal price].[price]?

Screenshot 2022-07-28 062905.png

 

Here is the link to the document: https://drive.google.com/drive/folders/1FRS9z4Zc7booJJ-KsxMUB_-HEWmMnJmJ?usp=sharing 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PowerVisualBI ,

 

You should first create a new date table to combine two dates in different tables.

 

But I find that in your “harga_normal” table, the date column has something wrong, perhaps there is an error in the data, I have sieved out the zero dates for ease of calculation.

vmengzhumsft_0-1659404184624.png

Table = DISTINCT( UNION(VALUES(out_of_stock[created_at]),calculatetable (VALUES('harga_normal'[updated_at]),FILTER('harga_normal',harga_normal[updated_at]<> "0000-00-00 00:00:00") )))

 

And then create two measure to achieve what you want:

 

QTY = CALCULATE(SUM(out_of_stock[qty]),FILTER('out_of_stock',[created_at]>=MIN('Table'[created_at])&& out_of_stock[created_at]<=MAX('Table'[created_at])))

Harga = CALCULATE(SUM(harga_normal[harga]),FILTER('harga_normal',[created_at]>=MIN('Table'[created_at])&& harga_normal[created_at]<=MAX('Table'[created_at])))

For more details you can view this file.

 

Best regards,

Community Support Team Selina zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @PowerVisualBI ,

 

You should first create a new date table to combine two dates in different tables.

 

But I find that in your “harga_normal” table, the date column has something wrong, perhaps there is an error in the data, I have sieved out the zero dates for ease of calculation.

vmengzhumsft_0-1659404184624.png

Table = DISTINCT( UNION(VALUES(out_of_stock[created_at]),calculatetable (VALUES('harga_normal'[updated_at]),FILTER('harga_normal',harga_normal[updated_at]<> "0000-00-00 00:00:00") )))

 

And then create two measure to achieve what you want:

 

QTY = CALCULATE(SUM(out_of_stock[qty]),FILTER('out_of_stock',[created_at]>=MIN('Table'[created_at])&& out_of_stock[created_at]<=MAX('Table'[created_at])))

Harga = CALCULATE(SUM(harga_normal[harga]),FILTER('harga_normal',[created_at]>=MIN('Table'[created_at])&& harga_normal[created_at]<=MAX('Table'[created_at])))

For more details you can view this file.

 

Best regards,

Community Support Team Selina zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@PowerVisualBI , If you want two dates to use the same date slicer. hen you should create a common date table and join with dates (dates should not have timestamps)

One join will be inactive , which you can activate using userelationship

 

 

Created Date = datesvalue([created_at]) //in case date is with time

 

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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