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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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")

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")

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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