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
gianmarco
Helper IV
Helper IV

Calculated column

Hey there!

Got a question. Considering the following table:

CODEDESCVALUE
ADesc120
A

Desc2

50
AX100
BDesc110
BDesc230
BDesc360
CDesc1100
CX30
CDesc240
CDesc350

 

I need to create a Calculated Column based on the following condition:

If a certain code "contains" Desc X, then calculate the double of column value EXCEPT the X's values.

The result would be the following table:

CODEDESCVALUENEW COLUMN
ADesc12040
A

Desc2

50100
AX100null
BDesc110null
BDesc230null
BDesc360null
CDesc1100200
CX30null
CDesc24080
CDesc350100

 

Thanks for your support 🙂

gianmarco

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@gianmarco 

pls try this

Column = 
VAR _x=maxx(FILTER('Table (2)','Table (2)'[CODE]=EARLIER('Table (2)'[CODE])&&'Table (2)'[DESC]="X"),'Table (2)'[VALUE])
return if(ISBLANK(_x)||'Table (2)'[DESC]="X",blank(), 'Table (2)'[VALUE]*2)

1.PNG





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

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@gianmarco 

pls try this

Column = 
VAR _x=maxx(FILTER('Table (2)','Table (2)'[CODE]=EARLIER('Table (2)'[CODE])&&'Table (2)'[DESC]="X"),'Table (2)'[VALUE])
return if(ISBLANK(_x)||'Table (2)'[DESC]="X",blank(), 'Table (2)'[VALUE]*2)

1.PNG





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

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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