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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.