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 All,
I want to write a DAX query to show the subcategory along with the Score for a particular category.
For ex- I want to display the sub-category values belonging to animal category. The input is:
Category | sub-category | Score |
Animal | Dog | 1 |
Animal | Cat | 2 |
Animal | Horse | 3 |
Mineral | Quartz | 1 |
Mineral | Silica | 2 |
Mineral | gypsum | 1 |
Mineral | feldspar | 2 |
Vegetable | carrot | 3 |
Vegetable | tomato | 1 |
I want the output as:
Dog | 1 |
Cat | 2 |
Horse | 3 |
Thanks in advance!
Solved! Go to Solution.
@shubhrika , Not sure I got it
Try a measure like this with sub category
calculate(sum(Table[Score]) , filter(Table, Table[Category] = "Animal"))
@shubhrika , Not sure I got it
Try a measure like this with sub category
calculate(sum(Table[Score]) , filter(Table, Table[Category] = "Animal"))
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |