Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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]?
Here is the link to the document: https://drive.google.com/drive/folders/1FRS9z4Zc7booJJ-KsxMUB_-HEWmMnJmJ?usp=sharing
Solved! Go to Solution.
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.
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
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.
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
@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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
24 | |
20 | |
15 | |
13 |
User | Count |
---|---|
51 | |
46 | |
39 | |
19 | |
19 |