Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hey there!
Got a question. Considering the following table:
CODE | DESC | VALUE |
A | Desc1 | 20 |
A | Desc2 | 50 |
A | X | 100 |
B | Desc1 | 10 |
B | Desc2 | 30 |
B | Desc3 | 60 |
C | Desc1 | 100 |
C | X | 30 |
C | Desc2 | 40 |
C | Desc3 | 50 |
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:
CODE | DESC | VALUE | NEW COLUMN |
A | Desc1 | 20 | 40 |
A | Desc2 | 50 | 100 |
A | X | 100 | null |
B | Desc1 | 10 | null |
B | Desc2 | 30 | null |
B | Desc3 | 60 | null |
C | Desc1 | 100 | 200 |
C | X | 30 | null |
C | Desc2 | 40 | 80 |
C | Desc3 | 50 | 100 |
Thanks for your support 🙂
gianmarco
Solved! Go to Solution.
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)
Proud to be a Super User!
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)
Proud to be a Super User!