Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi all,
I Have two tables
one is dProduct and other fStock_line
in dProduct I want to create a calculated Col that do a switch() statment and I have dificult to get information from fStock_line
my code is the follow :
Solved! Go to Solution.
Hi, @Anonymous
You need to change your calculated column to measure to display dynamically.
Like this:
Priority =
SWITCH (
TRUE (),
MAX ( dProduct[QtyMin] ) <> "NULL"
&& SELECTEDVALUE ( fStock[SV_STOCK] ) = 0, 1,
MAX ( dProduct[QtyMin] ) <> "NULL"
&& SELECTEDVALUE ( fStock[SV_STOCK] ) > 0, 2,
MAX ( dProduct[QtyMin] ) <> "NULL"
&& SELECTEDVALUE ( fStock[SV_STOCK] )
< MAX ( dProduct[QtyMin] ) / 2, 3,
0
)
Best Regards,
Community Support Team _Janey
If this post helps, then please consider Accept it as the solution to help the other members find it more.
I would like to add more information
I have these two tables TABULAR Model.
dProduct
Code PNM RefNumber QtyMin
105949 105826 601C3103 1
110115 66697 1700639 1
111894 54576 4952826 2
114257 104692 4505005B 0
664405 49464 65B89696 NULL
664406 71089 2092D NULL
fStock
dProductcode PNM SV_STOCK
111894 54576 0
114257 67934 0
110115 66697 1
111894 54576 2
I try to do a switch condition between these two tables
like the follow condition
Priority = SWITCH(TRUE(),
dProduct [QtyMin]<>"NULL" && SELECTEDVALUE(fStock[SV_STOCK])= 0 , 1,
dProduct[QtyMin]<>"NULL" && SELECTEDVALUE(fStock[SV_STOCK]) > 0 , 2,
dProduct [QtyMin]<>"NULL" && SELECTEDVALUE(fStock[SV_STOCK] < dProduct [QtyMin]/2 , 3,
0)
Hi, @Anonymous
You need to change your calculated column to measure to display dynamically.
Like this:
Priority =
SWITCH (
TRUE (),
MAX ( dProduct[QtyMin] ) <> "NULL"
&& SELECTEDVALUE ( fStock[SV_STOCK] ) = 0, 1,
MAX ( dProduct[QtyMin] ) <> "NULL"
&& SELECTEDVALUE ( fStock[SV_STOCK] ) > 0, 2,
MAX ( dProduct[QtyMin] ) <> "NULL"
&& SELECTEDVALUE ( fStock[SV_STOCK] )
< MAX ( dProduct[QtyMin] ) / 2, 3,
0
)
Best Regards,
Community Support Team _Janey
If this post helps, then please consider Accept it as the solution to help the other members find it more.
Hey @Anonymous ,
do you want the column to be dynamic?
Because this is not possible, calculated columns are always static and don't have a filter context. So the SELECTEDVALUE won't work in a calculated column.
If you give more information I can try to help you to get the result you want.
Hi Denis,
yes I would like do the column dynamic
thanks,
peter
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 80 | |
| 40 | |
| 31 | |
| 27 | |
| 27 |