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
Anonymous
Not applicable

I need to create a slicer in AAS model

Hi,

Currently, 

I'm trying to create a slicer to filter depending on one or more conditions to get " active / inactive " 

suppose you have a product and it's on sale and it's sold = active / it's not on sale and it's not sold = inactive

I can create slicers in pbix file, but since I'm using visual studio (AAS model in there)
and I have datasets from ssms. I could create measures in visual studio, also in pbix.

Can I create a measure brings me that solution in only pbix ? 
Because I suppose I need a calculated column first to show to results in slicer to switch.
I can only write it down in SSMS, then I will have to deploy to AAS Model, so I can use it in pbix

Is there any other way? 

3 REPLIES 3
Anonymous
Not applicable

Hi, 

Thank you for respond.

Since, I'm using AAS model

I guess I will have to use adding a new column in SSMS and deploying to AAS model, finally I can use that calculated column in power bi to get the result in slicer.

 

So, this is close to your first solution (1.) right ?

HI @Anonymous,

In fact, calculated columns can't get the selection from filters, their results will be fixed and not respond with filters. So measure filter can be a choice for your scenario, you can add conditions in the measure expression and return flags, then use the flag to filter records.
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

Current power bi does not support creating a dynamic calculated column/table based on filter and slicer effect. (they are working on different levels, you cant use child level to affect its parent levels)
I'd like to suggest you create a measure instead then you can use it on the visual level filter to filter records.

Applying a measure filter in Power BI - SQLBI

Notice:

1. the data level of power bi.

Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)

2. Create calculated column on database side also not be a good choice, these columns only update when the data source updates.

Regards,

Xiaoxin Sheng

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

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.