The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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?
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
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