The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi everyone, thanks in advance for your help. I'm not sure if this is even possible via DAX, but here we go:
Background:
I have a Sales table with columns [Markets], [Product Category], [Product Department], and [Dol Sales]. For each department there are multiple categories, but for each category just one department.
I have a slicer that has my list of categories (only one category will be selected)
I'm looking to do the following for a given market:
1. Find the department of the category selected in the slicer
2. Find the top 10 categories by Dol Sales within that department and display them in a chart. If the category selected in the slicer is not in the top 10, display it as well
No idea if this is possible, but I appreciate all of your help
Solved! Go to Solution.
Once you pick a value in a slicer, your table visual will filter to just that category. Two immediate thoughts are:
1. Add Category and Department slicers. When you pick a category, Department slicer will filter too. Click that department, then uncheck category. Create table visual with a TopN type measure or use the TopN filter in Filter Panel. Not ideal for the user, I know.
2. Disconnected table approach (recommended) - reference your intial table in query editor, remove all but Category and Department columns, remove duplicates on Category. Load that table but do not make a relationship to your Sales table. Then use the Category column from that new table as your slicer, but the original Category column in your table visual. Then use a measure like this:
New Measure = var selecteddepartment = selectedvalue(SlicerTable[Department])
return calculate(sum(Sales[Amount]), treatas(values(SlicerTable[Department]), Sales[Department]))
Add a TopN filter on the table visual for Department with same measure (or add TopN clause to the measure).
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Once you pick a value in a slicer, your table visual will filter to just that category. Two immediate thoughts are:
1. Add Category and Department slicers. When you pick a category, Department slicer will filter too. Click that department, then uncheck category. Create table visual with a TopN type measure or use the TopN filter in Filter Panel. Not ideal for the user, I know.
2. Disconnected table approach (recommended) - reference your intial table in query editor, remove all but Category and Department columns, remove duplicates on Category. Load that table but do not make a relationship to your Sales table. Then use the Category column from that new table as your slicer, but the original Category column in your table visual. Then use a measure like this:
New Measure = var selecteddepartment = selectedvalue(SlicerTable[Department])
return calculate(sum(Sales[Amount]), treatas(values(SlicerTable[Department]), Sales[Department]))
Add a TopN filter on the table visual for Department with same measure (or add TopN clause to the measure).
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Disconnected table makes perfect sense. Thanks!
User | Count |
---|---|
15 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
25 | |
13 | |
13 | |
8 | |
8 |