Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MattKarriker2
Helper II
Helper II

Custom Customer groupings

I am working on a project to replace MicroStrategy reporting with Power BI.  The project is based on a data warehouse for analyzing customers.  The current solution in MicroStrategy allows the user to supply custom criteria to formulate each group.  Example below.  

 

Group 1 - Customers who Spent more than $200 at Store 3 last week

Group 2 - Cutomers who used more than 2 coupons at Store 4 last week

Group 3 - All customer in Zip code 11111

 

The groups are completly dynamic.  They can use almost any combination of attributes and metrics to create the groups.  When the reports are executed these groups are displayed in a matrix view with what ever attributes and measure they wish to see and the 3 groups are listed on colums of the Matrix as displayed below.   

 

 Group 1 Group 2  Group 3 
Product Group    Sales $UnitsSales $UnitsSales $ Units
PG112.3261.231250.4527
PG231.7832.51100.2312
PG35.6721.5134.235

 

I am currently attempting to use calcualtion groups for this solution.  I created a Calcualtion group with 3 members Group1, Group 2 , and Group3.   I added multiple disconnected dimension tables for customers, products, etc. so each group can have their own  set of tables for filtering. There are about 20 measures the user can use in these group configurations.  For this I have added variable tables for each measure the user can filter.  I can capture these selections by checking if the variable table is filtered. 

 

My issue is how can I dynamically incorporate these measure filters into my group calculation.  Right now I would have to write ALOT of Dax code to account all of the differenct combinations of the measures.  I need a way to look through all 20 possibilities and only apply the measures the user filtered and ignore the rest or all if the user is not supplying filters.  I dont know of a way to create a filter for each measure and pass blank() or even a 1=1 comparison if the measure is not used.  I also dont know a way to build a string of comparisons and pass that to the calculations.  Otherwise I am stuck tryging to write a DAX statement for all combinations of measures which is not feasable or maintainable as the model expands.  

 

Any ideas?

I am open to complete revamping of the solution if someone has a better approach I can incorporate.  

1 REPLY 1
daxer-almighty
Solution Sage
Solution Sage

Disconnected tables? I don't think so. If you want to be able to show any measure and at the same time filter it by the group, then you just create a calculation group which takes into account the group you're interested in. Each item will be just filtering the current measure by the conditions relevant to one specific group and one item in there will be neutral - it'll return the original measure. Is this not all you need? You just want to be able to show any regular measure being filtered according to any of the groups. What I've described above gives you exactly that. But I'd say disconnected tables are totally redundant. Please build a good, logical, correct model and then add the calculation group I'm talking about.

 

Unless... I don't fully understand the requirements.

 

"The groups are completly dynamic.  They can use almost any combination of attributes and metrics to create the groups." 

 

I don't think this is feasible but I'd need to see the project to be able to tell you. But at first sight it looks like you're demanding a bit too much of Power BI...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.