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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Praj
Helper I
Helper I

How to aggregate rows based on columns

Hello Everyone, 

 

I have the below source table where each account has the RAG status. 

Praj_0-1671112358381.png

I am trying to create a new output table from the above pasted table to get the unique account name and respective status. Below is the output table I am looking for using DAX. 

Praj_1-1671112510506.png

I tried the lookup however, due to accounts associated with multiple status it throwed an error. Any approach on this problem will help me a lot.

 

TIA

 

Cheers,

Praj

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Praj ,

 

Please try:

Table 2 = DISTINCT( SELECTCOLUMNS('Table',"Account",[Account],"Status",[Status]))

Eyelyn9_0-1672211061041.png

 

Best Regards,
Eyelyn Qin
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

3 REPLIES 3
Anonymous
Not applicable

Hi @Praj ,

 

Please try:

Table 2 = DISTINCT( SELECTCOLUMNS('Table',"Account",[Account],"Status",[Status]))

Eyelyn9_0-1672211061041.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

FreemanZ
Super User
Super User

Hi @Praj 

In case of multiple status for one account, which do you expect to return?

Hi @FreemanZ , 

Thanks for your response. 

In case of multiple status, I am expecting the worst case. (If single account has red and green status, I am looking for red as the final status in my output table)

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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