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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Greg_Deckler
Super User
Super User

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


@ 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!:
The Definitive Guide to Power Query (M)

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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