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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
shubhrika
Frequent Visitor

How to write a DAX query to display the subcategory along with it's value for a specific category?

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:

Categorysub-categoryScore
AnimalDog1
AnimalCat2
AnimalHorse3
MineralQuartz1
MineralSilica2
Mineralgypsum1
Mineralfeldspar2
Vegetablecarrot3
Vegetabletomato1

 

I want the output as:

 

Dog1
Cat2
Horse3

 

Thanks in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@shubhrika , Not sure I got it

Try a measure like this with sub category

calculate(sum(Table[Score]) , filter(Table, Table[Category] = "Animal"))

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@shubhrika 

 

You want a DAX query or a DAX measure? These are 2 totally different things...

amitchandak
Super User
Super User

@shubhrika , Not sure I got it

Try a measure like this with sub category

calculate(sum(Table[Score]) , filter(Table, Table[Category] = "Animal"))

@amitchandak thanks alot! It worked

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors