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

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

Reply
Anonymous
Not applicable

How to change columns based on another column

Hi, I am trying to get from here: 

AndrejBI_0-1612357673328.png

To here: 

AndrejBI_1-1612357701441.png

 

In other words, I would like to use Code to adjust Name and Active, yet count should be just summed up. Any idea how to do it?

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

How to get the name? Do you want to get the name which active is "yes"?

if so, you can try this.

Table 2 = SUMMARIZE('Table','Table'[CODE],"COUNT",SUM('Table'[COUNT]),"NAME",MAXX(FILTER('Table','Table'[ACTIVE]="Yes"),'Table'[Name]),"Active","Yes")

1.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.


Best Regards,
Stephen Tao

Anonymous
Not applicable

Hi @Anonymous ,

 

You could try to use ALLEXCEPT function to get the separate results.

CALCULATE(COUNT(...), ALLEXCEPT(Table, Table[Name]))

 

Best Regards,

Stephen Tao

 

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

ryan_mayu
Super User
Super User

@Anonymous 

How to get the name? Do you want to get the name which active is "yes"?

if so, you can try this.

Table 2 = SUMMARIZE('Table','Table'[CODE],"COUNT",SUM('Table'[COUNT]),"NAME",MAXX(FILTER('Table','Table'[ACTIVE]="Yes"),'Table'[Name]),"Active","Yes")

1.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.