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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
olimilo
Continued Contributor
Continued Contributor

Comparing KPIs of Selected Entity against All Other Entities

I'm trying to do this metric comparison between an entity the user selects against the metric of everything else in the dataset. For example, if the user selects the Vendor ADA from the slicer, it should show up on the left graph and the right graph should show the data for all the other vendors except the selected vendor (I just selected the visual-level slicers for the image below to demonstrate):

 

olimilo_2-1750652587773.png

 

Previously, the way I did it was I created 2 datasets: 1 that the user can filter and 1 that is a "global" dataset that cannot be filtered so I can get the entire team's KPI and compare it against the selected reviewer. However, this means that the selected reviewer is still included in the global dataset.

 

olimilo_0-1750652235396.png

 

Is there a better way of doing this?

 

Edit: So following the video below, I was able to exclude the selected slicer value from the right visual, but how do I retain the selected slicer value on the left visual when the slicer dimension is not in the same table?

https://www.youtube.com/watch?v=pEAwvMkpA8I

1 ACCEPTED SOLUTION

Hi @olimilo,
Thank you for follow up
You can achieve this comparison by using a separate vendor table for slicer selection and applying DAX measures with filter logic to split visuals between the selected vendor and all others.

SelectedVendor_Flag = 
VAR SelectedVendor = SELECTEDVALUE('DIM_Vendor'[Vendor])
RETURN
IF(
    MAX(VendorGrades[Vendor]) = SelectedVendor,
    1,
    0
)

 

SelectedVendor_Value = 
VAR SelectedVendor = SELECTEDVALUE('DIM_Vendor'[Vendor])
RETURN
CALCULATE(
    SUM(VendorGrades[Value]),
    VendorGrades[Vendor] = SelectedVendor
)

 Please find the attached pbix for your reference.
If this answer was helpful, please consider marking it as Accepted Solution and giving a Kudos, it helps the community.

Best Regards,
Harshitha.

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Not sure how much i can help but i'd like to try.  Share the download link of the PBI file.  Share the bare minimumum table/columns which are required for solving this problem.  Please remove unnecessary tables/columns from that file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-hjannapu
Community Support
Community Support

Hi @olimilo,

Thank you  for reaching out to the Microsoft fabric community forum.

you can do this by creating a separate vendor table for the slicer and using SELECTEDVALUE to get the selected vendor. Then create two measures one for the selected vendor’s data and another for all other vendors using FILTER inside CALCULATE. Use these measures in two separate visuals. This will give you the exact comparison you’re looking for. 
              

I tested it with my sample data, and it is working fine. Please find the attached Pbix for your reference.

If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

Best Regards,
Harshitha.


olimilo
Continued Contributor
Continued Contributor

Is there a way to make the measure result works as a filter/flag? I am using the following to exclude the selected value:

 

Exclude Vendor? = 
    IF(
        MAX('Project'[Vendor]) IN ALLSELECTED('DIM_Vendor'[Vendor])
        && COUNTROWS(ALLSELECTED('DIM_Vendor'[Vendor])) <> COUNTROWS(ALL('Project'[Vendor])),
        1,
        0
    )

 

However, I am getting problems getting the one for the selected value. This one isn't working as I expected:

 

Selected Vendor = 
    VAR val = SELECTEDVALUE('DIM_Vendor'[Vendor])
    VAR tmpTable = 
        CALCULATETABLE(
            VALUES('Project'[Vendor]),
            FILTER(ALL('Project'), 'Project'[Vendor] = val)
        )
    
    RETURN IF(VALUES('Project'[Vendor]) = val, 1, 0)

 

Hi @olimilo,
Thank you for follow up
You can achieve this comparison by using a separate vendor table for slicer selection and applying DAX measures with filter logic to split visuals between the selected vendor and all others.

SelectedVendor_Flag = 
VAR SelectedVendor = SELECTEDVALUE('DIM_Vendor'[Vendor])
RETURN
IF(
    MAX(VendorGrades[Vendor]) = SelectedVendor,
    1,
    0
)

 

SelectedVendor_Value = 
VAR SelectedVendor = SELECTEDVALUE('DIM_Vendor'[Vendor])
RETURN
CALCULATE(
    SUM(VendorGrades[Value]),
    VendorGrades[Vendor] = SelectedVendor
)

 Please find the attached pbix for your reference.
If this answer was helpful, please consider marking it as Accepted Solution and giving a Kudos, it helps the community.

Best Regards,
Harshitha.

Hi @olimilo,

Just wanted to check if you had the opportunity to review the suggestion provided?

If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.

 

Thank You.

Harshitha.

Hi @olimilo ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please Accept it as a solution so that other community members can find it easily.


Thank you.

Hi @olimilo  ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please Accept it as a solution so that other community members can find it easily.


Thank you.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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