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.
Hi,
I have an issue that I can't wrap my head around regarding the relationship between a dimension table and a fact table.
Background:
The problem:
Let's say we have a Markdown called "Summer Markdown" consisting of 200 products, i.e. 200 products got a reduced price during the "Summer Markdown". I want to be able to see what the Sales are for these 200 products. Therefore, I want to filter the Product table from the Markdown table '(when I select "Summer Markdown"), see the picture below. And this doesn't work, except if we break the star model structure and thus significantly degrade the performance of the model.
So far, I've created a hidden many-to-many relationship (had to make a many-to-many relation in Tabular Editor) between the Markdown table and the Product table (Markdown filtering Product), then enabled it in specific measures. But this makes both the report and model REALLY slow.
My plan B is to remake my Markdown table to be a dimension and then in some way connect it directly to the Sales table, so I don't have to go "over" the Product table.
Does anyone have any ideas on how to solve this? And not decreasing the model performance. Let me know if I was unclear 🙂
/Ella
Solved! Go to Solution.
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Sales: =
VAR _ProductByMarkdownTypeByDate =
SUMMARIZE (
GENERATE (
markdown,
FILTER (
'calendar',
'calendar'[Date] >= markdown[markdown_startdate]
&& 'calendar'[Date] <= markdown[markdown_enddate]
)
),
markdown[article_id],
'calendar'[Date]
)
RETURN
IF (
ISFILTERED ( markdown_type[markdown_type] ),
CALCULATE (
SUM ( sales[sales_amount] ),
TREATAS (
_ProductByMarkdownTypeByDate,
'product'[article_id],
'calendar'[Date]
)
),
SUM ( sales[sales_amount] )
)
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Sales: =
VAR _ProductByMarkdownTypeByDate =
SUMMARIZE (
GENERATE (
markdown,
FILTER (
'calendar',
'calendar'[Date] >= markdown[markdown_startdate]
&& 'calendar'[Date] <= markdown[markdown_enddate]
)
),
markdown[article_id],
'calendar'[Date]
)
RETURN
IF (
ISFILTERED ( markdown_type[markdown_type] ),
CALCULATE (
SUM ( sales[sales_amount] ),
TREATAS (
_ProductByMarkdownTypeByDate,
'product'[article_id],
'calendar'[Date]
)
),
SUM ( sales[sales_amount] )
)
You should be able to create a one-to-many relationship between Product and Markdown (join on ArticleID). Then create a measure like the one below. The CROSSFILTER function allows bidirectional filtering within the scope of the measure.
Amount =
CALCULATE (
SUM ( Sales[Amount] ),
CROSSFILTER ( Markdown[ArticleID], Product[ArticleID], BOTH )
)
Proud to be a Super User!
For your reference.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
70 | |
37 | |
29 | |
27 |
User | Count |
---|---|
91 | |
49 | |
45 | |
38 | |
36 |