Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |