cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Capono
Frequent Visitor

Advance Filter on Measures with IFilterMeasureTarget

 

Hi, I was trying to implement the advance filter as shown for the sampleSlicer for API 1.7.0. This works great.

 

My question is now is it also possible to filter on measures, since I found the target IFilterMeasureTarget for the target value. If yes what do I have to put for table and measure for the target values?

 

 

Looking forward to an answer, thanks.

 

With Regards

 

Asamah

7 REPLIES 7
v-viig
Community Champion
Community Champion

Hello @Capono

 

I think that you should use something like this:

let valueColumn: DataViewValueColumn = this.dataView.categorical.values[0];

let target: IFilterColumnTarget = {
    table: valueColumn.source.queryName.substr(0, valueColumn.source.queryName.indexOf('.')),
    column: valueColumn.source.displayName
};

return target;

Please let me know if this code resolves the issue.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Capono
Frequent Visitor

Hi,
thanks .
This works only if the measures are not aggregated, i already tried that and this works only if you have the correct table name and the correct column name which is not the case on aggregated values. I was hoping to be able on Filterung by a aggregated measures with .IFilterMeasureTarget.
v-viig
Community Champion
Community Champion

Have you tried something like this?

let valueColumn: DataViewValueColumn = this.dataView.categorical.values[0];

let target: IFilterMeasureTarget = {
    table: valueColumn.source.queryName.substr(0, valueColumn.source.queryName.indexOf('.')),
    measure: valueColumn.source.queryName,
};

return target;

Please let me know if that works. Otherwise, it'd be better to create a question at powerbi-models GitHub repository.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Capono
Frequent Visitor

Thanks, for your time. This didn't work there should be a documentation how to use this.

v-viig
Community Champion
Community Champion

It'd be good if you could create an issue at Power BI Models GitHub.

There're experienced developers who develop and support the Advanced Filter.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

nhuzaa
Frequent Visitor

I did try the above approach but its not working for me aswell.

Where can I find proper documentation to implement

IFilterMeasureTarget

v-viig
Community Champion
Community Champion

We'd recommend to request assistance via this form.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors