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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ArielK
Frequent Visitor

Remove relationship filter in measure

Hello Experts

 

I have report where I should show KPI value for department but also avg for the whole company.

 

For the company value I wrote measure that worked ok with any slicers in the report:

 

CALCULATE(

    AVERAGE(KOM_WSP[Wartość]),

    ALLEXCEPT('KOM_WSP',

        KOM_WSP[Atrybut.1],

        KOM_WSP[Atrybut.2],

        KOM_WSP[ROK])

)

 

After that I added RLS table ('RLS') that filters main table ('KOM_WSP') on the department. Since that, company KPI shows the same value as department one (what is obvious as the 'KOM_WSP' is filtered by 'RLS'), and unfortunately any approach to solve it didn’t work.

 

I tried variant with CROSSFILTER defined as “NONE” , as below:

 

CALCULATE(

    AVERAGE(KOM_WSP[Wartość]),

    CROSSFILTER(RLS[ALIAS], KOM_WSP[DEP_Alias], none),

    ALLEXCEPT('KOM_WSP',

        KOM_WSP[Atrybut.1],

        KOM_WSP[Atrybut.2],

        KOM_WSP[ROK])

)

 

I tried variant with ALL and REMOVEFILTERS on RLS table:

 

CALCULATE(

    AVERAGE(KOM_WSP[Wartość]),

    ALL(‘RLS’),

    ALLEXCEPT('KOM_WSP',

        KOM_WSP[Atrybut.1],

        KOM_WSP[Atrybut.2],

        KOM_WSP[ROK])

)

 

I also tried different structures and variants of those functions, also tried to nest one calculate in another for each filter argument.

Still the same problem, company value = department value. And now I runned out of ideas.

 

I would appreciate any suggestion.

1 ACCEPTED SOLUTION
ArielK
Frequent Visitor

Ok, problem solved / unsolved. 

Problem comes from the nature of RLS, as according to MS manual, RLS doesn’t work as regular relationship. It comes first, before dax, and cut-off data before anything else, so for the report data "doesn't exist", and crossfilter function with "none" parameter doesn't change it (it removes relationship, but the data is not there).

To overcome it I just made new, unfiltered table as a source of company data.

View solution in original post

3 REPLIES 3
ArielK
Frequent Visitor

Ok, problem solved / unsolved. 

Problem comes from the nature of RLS, as according to MS manual, RLS doesn’t work as regular relationship. It comes first, before dax, and cut-off data before anything else, so for the report data "doesn't exist", and crossfilter function with "none" parameter doesn't change it (it removes relationship, but the data is not there).

To overcome it I just made new, unfiltered table as a source of company data.

ArielK
Frequent Visitor

Unfortunately I can't provide you with data, but structure of this part of report looks like that:

 

Relation looks like that (the green one has to be deactivated in the measure):

ArielK_0-1704964593996.png

KOM_WSP table:

ArielK_1-1704964952693.png

and RLS tabel like this:

ArielK_2-1704965034446.png

 

Anonymous
Not applicable

Hi @ArielK ,

 

Can you provide some test data and related screenshots as reference, so that I can answer your question as soon as possible.


Best Regards,
Adamk Kong

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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