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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Bernstra
Regular Visitor

Using a Measure to create a new column that can be used to filter

I am working with an Analysis Services dataset, and I do not have access to create a new column.  There is a column named "type" in the item table that we need to adjust, and then use to filter the data.  If I could create a column, then a couple IF statements and SWITCH work to do exactly what we need, but in this dataset that is not possible.  The data would be similar to the table below:

 

Item #GroupTypeNew Type
1AT1TA
2AT1TA
3BT2TB
4CT3TB

Where the New Type column is the column we would like to create:

Type T1 -> New Type TA

Type T2 -> New Type TB

Type T3 -> New Type TB

 

Is there a way to do this with a measure and be able to filter the table using the "new type"?

 

Thank you!

 

2 REPLIES 2
tackytechtom
Super User
Super User

Hi @Bernstra ,

 

How about this:

tomfox_0-1656020708729.png

 

TypeSwitchMeasure = 
SWITCH (
    TRUE(),
    MAX ( TableFilterExample[Type] ) = "T1", "TA",
    MAX ( TableFilterExample[Type] ) = "T2", "TB",
    MAX ( TableFilterExample[Type] ) = "T3", "TB",
    BLANK()
)

 

Note, measure cannot be used in slicers, so you need to use the fiilter pane to do filtering. Also, I highly recommend to ask your back end people to add the new types to the analysis services model. 

 

Hope it helps you anyway! 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Thank you @tackytechtom.  Unfortunately, I think getting the new types added to the model is probably the only way for this to work as we need.

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.