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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
psmith-nhs-inc
Helper III
Helper III

How to choose different columns from a filter

OK, I know how to do this with measures: build a table of selectors, create a filter on that table, create a measure using Switch() to choose between calculations depending on the MAX value of those selectors.  I have several working examples.  This is a little different however.

I started the same way:

I have a two column table with two entries:

Master-SingleID      Master-SingleSelect

1                              Master

2                              Single

 

In my item table I have a Master # (which is not unique) and a Single# which IS unique.  I am not doing math with these numbers, they are identifiers.

I have this calculated column:

Master-SingleValue = if(sum('MasterSku-Single3D'[Master-SingleID])=1,'Item'[master_sku],'Item'[singlesku)

This should return the value corrosponding to my selection, but it returns [singlesku] every time.

 

A card shows me that my filter selection is working, if I choose Master, sum('MasterSku-Single3D'[Master-SingleID])=1, if I choose Single, then sum('MasterSku-Single3D'[Master-SingleID])=2. 

 

The column however, only shows me [singlesku] no matter what I select.

 

My ultimate goal is to use this to populate the Row field of a matrix, with some averages and sums for values.

 

Any Ideas?

 

Thanx

 

Phil

 

 

 

 

3 REPLIES 3
Anonymous
Not applicable

Hi @psmith-nhs-inc,

 

Based on my understanding, you want to create a dynamic calculate column based on slicer, right?

If this is a case, power bi not support to use slicer to achieve the dynamic calculated column.(measure and slicer works on visual level; calculate column/table works on date model level)

Reference:

Calculated Column/Table Change Dynamically According to Slicer Selection in the Report.

 

Regards,

Xiaoxin Sheng

Greg_Deckler
Community Champion
Community Champion

Can you provide some sample data from your Item table to make this easier to recreate?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

https://www.dropbox.com/s/u0ozg7928zlpw60/Purchasingcutfor%20forums.pbix?dl=0

 

A little raw, as I just recreated the basics without much lipstick and glitter, but it should be easy to see what is going on and what I want.  The main visual has three coloumns, I want the first column to change between the 2nd and third column based on the slicer.

 

Thanx

 

Phil

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors