March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Okay, this one is a tough one for me but is probably very simple for some of the DAX gurus on this page.
I have two fact tables: Campaigns and Sales. Normally I use one item table for the sales facts that is based upon item number and then associates manufacturer and product catagory. The campaign table has both of those listings but not an item number which means it is a many to many connection which doesn't work too well. In order to calculate totals, I broke the item table into two pieces: Manufacturer and Product. Some campaigns have a manufacturer but not a product and some have a product and not a manufacturer. I would like to use this data to apply a weighted amount to manufacturers for product campaigns that do not have a manufacturer. I have given these generic names in order to build a foundation. What I don't know how to do is to bring the two look ups together. I would like to divide the product spend by the number of manufacturers for that product and assign it to the manufacturer to add to manufacturer specific totals.
Sample data:
Campaign Spend:
Campaign | Total Spend |
Caps | 125 |
Gowns | 230 |
Shoes | 551 |
Dresses | 321 |
A | 625 |
B | 741 |
C | 525 |
D | 112 |
Manufacturer
Manufacturers | Mfg Specific spend |
A | 625 |
B | 741 |
C | 525 |
D | 112 |
Product weighted
Products | Manufacturer | Weighted Spend |
Caps | A | 62.5 |
Caps | C | 62.5 |
Gowns | B | 76.66 |
Gowns | C | 76.66 |
Gowns | D | 76.66 |
Shoes | A | 137.75 |
Shoes | B | 137.75 |
Shoes | C | 137.75 |
Shoes | D | 137.75 |
Dresses | C | 160.5 |
Dresses | D | 160.5 |
Desired Outcome
Manufacturer | Total Spend |
A | 825.25 |
B | 955.41 |
C | 962.41 |
D | 486.91 |
Proud to be a Super User!
Solved! Go to Solution.
I ended up flattening this report through a series of other reports which I then imported as a dataset. It does require a series of refreshes instead of a single but it works.
Proud to be a Super User!
maybe its late , maybe i've not quite understood what you were trying to get at but you can get your desired outcome like this
ts:=CALCULATE(SUM(Manufacturer[Mfg Specific spend]))+CALCULATE(SUM('Product weighted'[Weighted Spend]),FILTER(CROSSJOIN('Product weighted',Manufacturer),'Product weighted'[Manufacturer]=Manufacturer[Manufacturers]))
@kcantor I believe you can do this with Summarize again
I tested with your data then added some additional refreshed and it seems to work...
But then again I don't know if this would work for you... Let me know.
This doesn't seem to be helping me as my data is more complex than this simple set of example data. Can I send you an actual sample?
Proud to be a Super User!
@kcantor I just had the feeling it would not - it was just too easy...
As far resources I think we all learn from Marco and Alberto's Books and very helpful site
and same applies to Rob Collie's Books and website - which I've seen you recommend too
I do use those books and sites as well. I have messaged you a copy of the data. Hopefully you can guide me to what I am doing wrong.
Proud to be a Super User!
So, what I have done . .
I added a calculation to determine how many manufacturers exist within a catagory. I added a calculated column to determine if an ad group had a related manufacturer. I created a calculation dividing the sum of ad group costs where "had mfg" = 0 to determine how much to add to each mfg within a catagory. Now I just have to figure out how to apply that amount automatically across the board.
messy
cumbersome
ugly
Any ideas?
Proud to be a Super User!
Win a shirt . . . solve my problem to earn points. 🙂
In other words "BUMP"
Proud to be a Super User!
I ended up flattening this report through a series of other reports which I then imported as a dataset. It does require a series of refreshes instead of a single but it works.
Proud to be a Super User!
Glad you got it working! This data set was a nightmare - blanks, negative values in what seemed like every field in every table
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
93 | |
91 | |
86 | |
77 | |
49 |
User | Count |
---|---|
164 | |
149 | |
101 | |
73 | |
56 |