Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I realize there are other questions with the same title but there are no solutions that fit my scenario.
Tables:
1. Sales Detail table with millions of rows and repeat Item #'s obviously (on different orders)
2. Discount table with different groups of items group by a Discount Name. Each Discount Name has unique items but items will repeat across different Discount Name i.e. Discount September has Item 1234 and Discount October has 1234.
Join:
1. Item # (no other link possible as the discount #/name is not captured on the sales order)
Filter:
You will always choose a Discount Name via a filter so you'll always preselect a group of unique items.
This metric was "close" from another similar question but was non-performant and seemed to be duplicating quite often when I did get it to load:
SUMX(VALUES(Table1[YEAR]),[YEAR])-SUM('Table'[Year])
The calculated column that works in a many to one looks like this but of course, that does not work once many to many is the relationship:
Hi @USABB_Data
Please provide sample data that fully covers your issue and the expected outcome based on the sample data you provided.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @USABB_Data -you could create a bridge table with distinct Item # if needed, but that depends on your data structure. one more, If you are working on large datasets, it's crucial to avoid calculated columns or using RELATED in a many-to-many scenario, as it can lead to performance degradation.
Instead, keep calculations in measures to allow DAX to perform calculations dynamically based on filters.
Below is the measure for example:
Price Match Discount Measure =
IF (
ISFILTERED('Discount'[Discount Name]),
CALCULATE(
IF (
ABS(SUM('Sales Detail'[Price]) - SUM('Discount'[Item_Price])) < 0.01,
"Y",
"N"
),
FILTER(
'Sales Detail',
'Sales Detail'[Item #] IN VALUES('Discount'[Item #])
)
),
BLANK()
)
Hope this helps
Proud to be a Super User! | |
Thanks for the suggestion. This did not return the correct results and was non-performant when added to a table visual with other columns.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
76 | |
61 | |
36 | |
32 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |