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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.