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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
dkg8
New Member

Calculate Column based on slicer selection of another table

Hi all,

Thank you in advance.

 

Tablename - MyStoreItemMaster

dkg8_0-1699461015638.png

Tablename – MyStoreItemInventory

dkg8_1-1699461037968.png

Relationship

dkg8_2-1699461051279.png

 

I need to flag each ItemNo at the MyStoreItemMaster based on the pcs-XX columns, considering the Region Slicer User Selection, and irrespective of whether Inventory data exists for the ItemNo.

Note - MyStoreItemMaster does not have Region column.

 

User select - US

dkg8_3-1699461157533.png

MyStoreItemMaster with new calculated column HasForecastUnits

dkg8_4-1699461176637.png

 

User select - RG-CA

dkg8_5-1699461221386.png

User select - RG-EU

dkg8_6-1699461246762.png

User select - RG-UK

dkg8_7-1699461268597.png

 

Could you please provide guidance on how to accomplish this?

 

9 REPLIES 9
JohnnySaade
Helper I
Helper I

Try creating a conditional measure that will flag your items like so:

add variable that will change dynamically the pcs column depending on your selection using SWITCH then use the measure

HasForecastUnits = if ( isblank(variable), "N" , "Y")

let me know if this worked or if you need help writing the switch variable.

dkg8_0-1699463210283.png

Thank you for your response, I tried this, but it didn't work. Please let me know if I'm overlooking something.

There was also the part where you use the variable in a IF confition, replace "return dPcsXX" with:

return

if ( isblank(dPcsXX), "N" , "Y")

dkg8_0-1699464433190.png

959473AA should be "N" since the pcs-US value is 0 but it is "Y"

Replace it with this:

if ( or(isblank(dPcsXX),dPcsXX=0), "N" , "Y")

dkg8_0-1699465223249.png

Now 39993BB should be "Y" since the pcs-US value is 3

Okay, question, the items under the RG-US region don't necessarily have values in the pcs-US column only ( item master table ), is it a typo or that's the normal behavior of the data?

Hi @JohnnySaade 

I applied the same logic, but instead of SelectedValue, I replaced it with Filters, and it's now working. Thank you for your help and quick responses. I appreciate it.

dkg8_0-1699470749517.png

 

Glad I was able to help!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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