Forum Discussion
How to put DAX measures into Matrix Columns?
Hello BI Community,
So I have 2 unrelated dimension tables "Products" and "Limits" they are connected to the same Fact which lists quantities sold.
At the lowest grain it's a many-to-many relationship. 1 product ID corresponds to many limits - evey year there is a different limit. And one limit can have many groups of products under it. Both tables have Product IDs in it as their lowest grain. I need to pull Limit levels from the Limit table based on the product ID from the product table. I created this DAX formula which works perfectly as a Matrix / Table value:
Calculate(max('LIMITS'[LVL1_LIMIT_LVL]),TREATAS(values(PRODUCTS[LVL1_PRODUCT_ID]),'LIMITS'[LVL1_PRODUCT_ID]),ALL(PRODUCTS))
The problem is that i need to put this measure in a column header to see mulitple groups of products with the same limit above in the column header. It works in the report builder but for various stupid compliance reasons i m not allowed to use it.
My only solution is to create a calulated column which can go into matrix columns but now we`re in a row context, not filter context and the above forumla obvioulsy doesnt work. I tried to tweak it for days, nothing ...
Any ideas on how to tweak the formula? Otherwise it will have to be some sort of merge between Limits and Product but beause it's a many to many it will produce many duplicates. I tried to build a bridge table between the 2 but it gives me an "ambiguity" error since they are connected to the same fact. Any ideas and how to solve this? I'm banging my head agianst the wall at this point..
1 Reply
- v-yanjiang-msft
Community Support
Hi Alice_BI ,
Could you please give a simple example, a little hard to reproduce the problem. Thanks!
Best Regards,
Community Support Team _ kalyj