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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Kavya123
Helper III
Helper III

Group By in DAX Measure

Hi Everyone,

 

I need to create a measure and do group by based on the Company name. For the below expression I need to get the values based on the aggregation of Company name. Please help me on this.

 

CALCULATE(sum( PROFILERTABLENEWSUBMITTED[answertest]) , FILTER(PROFILERTABLENEWSUBMITTED, CONCATENATE(PROFILERTABLENEWSUBMITTED[Answer Text], PROFILERTABLENEWSUBMITTED[Answer Text])="YesYes" ))
 
 
 
1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Kavya123 

If you use your formula in a measure, then you could only add "company name" and this measure in a table or matrix visual.

Measure = CALCULATE(sum( Sheet2[answertest]) , FILTER(Sheet2, CONCATENATE(Sheet2[Answer Text], Sheet2[Answer Text])="YesYes" ))

2.png

Or if you want to show all columns and measures together in a table visual, you could create another measure

Measure 2 = CALCULATE([Measure],ALLEXCEPT(Sheet2,Sheet2[company name]))

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @Kavya123 

If you use your formula in a measure, then you could only add "company name" and this measure in a table or matrix visual.

Measure = CALCULATE(sum( Sheet2[answertest]) , FILTER(Sheet2, CONCATENATE(Sheet2[Answer Text], Sheet2[Answer Text])="YesYes" ))

2.png

Or if you want to show all columns and measures together in a table visual, you could create another measure

Measure 2 = CALCULATE([Measure],ALLEXCEPT(Sheet2,Sheet2[company name]))

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

d_gosbell
Super User
Super User

If you drag Company Name and your measure onto a visual the Group By will happen automatically. However your measure looks overly complicated. Have you tried the following pattern?

 

CALCULATE(sum( PROFILERTABLENEWSUBMITTED[answertest])
    , PROFILERTABLENEWSUBMITTED[Answer Text] = "Yes"
    , PROFILERTABLENEWSUBMITTED[Answer Text])="Yes"
)

Hi,

 

Thanks for the reply. I have tried that but it is not working.

We can't really help much based on "it's not working".

 

Can you maybe paste in 5-10 example rows of data and then show us an example of the result you would expect the calculation to produce from that sample data?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.