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 have a data model with a measure for order amount. For simplicity:
-Fact table has four columns: order number, order amount, delivery_date, order_date.
-The fact table is connected with a dim table (Calendar) to the order_date column.
I need to calculate orders for the current order_date period (filtered with a slicer) BUT
it should exclude orders with delivery_dates that are outside the region.
I have tried to explicitly define the filter in the calculate but it seems to always also
include the implicit filters and/or include too much of the dim. I would like to have the result on the same granularity as the fact. Any suggestions?
I have tried (to no avail) :
order amount = CALCULATE(
SUM (Sales[orders]),
FILTER('Sales',
Sales[delivery_date] <= CALCULATE(
MAX('Calendar'[Date]),KEEPFILTERS('Calendar'[Date]))))
Hi, @datamortar
Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures. I look forward to your response.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi! Here is a snippet of the data with some of it randomized. https://www.dropbox.com/s/2k4vit6es7i0z49/question.pbix?dl=0
The problem is now that I can't have the dim calendar in the resulting table.
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 |
---|---|
42 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |