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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Change column attributes (DAX formula)

Lets_PowerBI_0-1662023822373.png

 

I would like to change "Type" column attributes by creating a calculated column. The "type B" is more valuable than the "type A". So, for each person in the table, if we have both types then replace them by "type B" otherwise leave it as it is.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , A new column

new column =

var _cnt = countx(filter(Table, Table[ID] =earlier([ID]) && [Type] = "Type B") , [ID])

return

if(isblank(_cnt), [Type], "Type B")

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you @amitchandak you made my day !

amitchandak
Super User
Super User

@Anonymous , A new column

new column =

var _cnt = countx(filter(Table, Table[ID] =earlier([ID]) && [Type] = "Type B") , [ID])

return

if(isblank(_cnt), [Type], "Type B")

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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