Forum Discussion
Sumifs in DAX, using a value in the same row as filter condition
- 9 years ago
Hi srl01
Ok apologies for sometimes going around in circles because I am trying to understand your requirements.
What I would then do is go into the Query Editor and copy the existing table (Source Table) where you have the details. Then in this second table (Brand Group) I would then look to get the Band Scoring per Basket ID. This could possibly be done with the Group By.
After which I would then merge my first table (Source Table) with my second table (Brand Group) on the Basket ID using a left join.
What this would then do is to take the Band Total and put it across all the rows in your first table (Source Table).
And then from there you could easily create a conditional column based on the Band Score.
That would then allow you to have all your data in columns in your dataset.
Hello GilbertQ
What I would do is to still create a measure which would add up the values based on the Brand Score.
Ok, so I have BrandScore:=sum(BrandScore[Score]) setup in my main table.
I would then have another mapping table which would have all the related Brand Scores
EG: 1, 10, 100, 111 etc.
And associated to each of these records I would then have what represents those numbers. (Which is what you have put in your example)
Yep, all set on that too - numbers mapped to various text values for BasketBrand.
Then finally all that you would need to do, is to create a lookup or another measure where it finds the Brand Score and then show the associated text?
This part I don't get. Firstly, I need to be able to filter on BasketBrand (e.g. using slicers) so needs to be a coulmn not a measure, right? But more fundamentally, I don't see how this approach isolates only the items in the same basket (i.e. those with the same basketID). Put another way I don't see anything equivalent to the SUMIFS in the excel example I originally pasted, which adds up brand scores only for the rows with the same basketID as the current row.
Hi srl01
Ok apologies for sometimes going around in circles because I am trying to understand your requirements.
What I would then do is go into the Query Editor and copy the existing table (Source Table) where you have the details. Then in this second table (Brand Group) I would then look to get the Band Scoring per Basket ID. This could possibly be done with the Group By.
After which I would then merge my first table (Source Table) with my second table (Brand Group) on the Basket ID using a left join.
What this would then do is to take the Band Total and put it across all the rows in your first table (Source Table).
And then from there you could easily create a conditional column based on the Band Score.
That would then allow you to have all your data in columns in your dataset.