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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
mapko
Helper I
Helper I

Equivalent to QV's Indirect Set Analysis

All,

 

I am an advanced QV developer and looking for a PBI equivalent to QV's indirect set analysis; the P and E functions.

 

For example, the following set analysis will calculate the average value for all excluded companies within a sector. Say I have 10 companies, selected one and this expression will perform average across remaining 9.

 

avg({<Company_Name= e(Company_Name), Sector= {'$(vSector)'}>} Value) 

 

Hope someone can share some ideas.

 

Thanks!

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @mapko

 

You can use the EXCEPT function to return the complement of the selected values of a particular column, similar to your example with the E function.

 

Here is an example pattern using arbitrary table/column/measure names:

=
CALCULATE(
    [Value],
EXCEPT(
ALL( Company[Company_Name] ),
VALUES( Company[Company_Name] )
)
)

 

I'm not really familiar with QlikView or the P & E functions (apart from Bing-ing them last night), but as for the P (possible values) function, I'm sure there are ways to replicate its behaviour in Power BI as well.

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

4 REPLIES 4
OwenAuger
Super User
Super User

Hi @mapko

 

You can use the EXCEPT function to return the complement of the selected values of a particular column, similar to your example with the E function.

 

Here is an example pattern using arbitrary table/column/measure names:

=
CALCULATE(
    [Value],
EXCEPT(
ALL( Company[Company_Name] ),
VALUES( Company[Company_Name] )
)
)

 

I'm not really familiar with QlikView or the P & E functions (apart from Bing-ing them last night), but as for the P (possible values) function, I'm sure there are ways to replicate its behaviour in Power BI as well.

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Hi @OwenAuger. Much appreciated! Indeed what I needed.

ankitpatira
Community Champion
Community Champion

@mapko With slight variation you can do similar in power bi desktop. Just create a measure as below which will give you average of values of all the selection you will make. So instead of getting avergae for ones that you don't select, instead select all that you want the average for.

 

Measure = CALCULATE( AVERAGE(YOURTABLE[valueColumn]), FILTERS(YOURTABLE[companyColumn]))

@ankitpatira, thank you for your reply. I don't think this is a good workaround for me. Simply because there will be cases when I have to compare a single company's values against a big number of other companies and I can't expect from my users to hand pick those. Hope that makes sense.

 

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors