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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
esingh
Helper I
Helper I

Create a company level visual based on two independent Slicer table

Hi Community

 

New to Power BI and still exploring. Need Help.

 

I have two independent slicer tables:

1) Selected Company- (Table Name:Slicer Selected Company)

2) Cohort Company- (Table: Slicer Cohort Company)

 

Need to create a visual Bar chart where individual company ( X axis) and sales(Y axis) can be created based on the selection in the two slicers. Need to show all company names(selected company and cohort companies in the X axis). The data is to be pulled from third independent table Company sales which contains company names and sales columns.

 

There is no realtionship existing between slicer and Fact table

 

Thanks

 

1 ACCEPTED SOLUTION
v-sshirivolu
Community Support
Community Support

Hi @esingh ,
Thanks for reaching out to the Microsoft fabric community.

Steps I have taken - 

Loaded the following sample data tables:

Sample Data Tables

Slicer Selected Company:

  • Alpha Corp
  • Beta Inc
  • Delta Group

Slicer Cohort Company:

  • Gamma Ltd
  • Beta Inc
  • Omega Pvt Ltd

Company Sales:

  • Alpha Corp: 100
  • Beta Inc: 200
  • Gamma Ltd: 150
  • Omega Pvt Ltd: 250
  • Zeta LLC: 300

Created a Combined Visual Axis Table

Visual Companies =
DISTINCT (
    UNION (
        SELECTCOLUMNS('Slicer Selected Company', "Company", 'Slicer Selected Company'[Company]),
        SELECTCOLUMNS('Slicer Cohort Company', "Company", 'Slicer Cohort Company'[Company])
    )
)

This merges both slicers into one axis table.

Created a Measure for Filtered Sales

In the Company Sales table, add this measure:

Filtered Sales =
VAR SelectedCompanies = VALUES('Visual Companies'[Company])
RETURN
CALCULATE(
    SUM('Company Sales'[Sales]),
    TREATAS(SelectedCompanies, 'Company Sales'[Company])
)


Built the Visual
Add a Clustered Column Chart
Set - 

X-Axis -  Visual Companies[Company]

Y-Axis (Values) - Filtered Sales (Measure)

Add slicers:
Slicer Selected Company[Company]
Slicer Cohort Company[Company]

The chart now dynamically displays companies selected in either slicer and their corresponding sales, even without direct relationships.

Please find the attached .pbix file for your reference.

Regards,
Sreeteja.

View solution in original post

12 REPLIES 12
v-sshirivolu
Community Support
Community Support

Hi @esingh ,
Thanks for reaching out to the Microsoft fabric community.

Steps I have taken - 

Loaded the following sample data tables:

Sample Data Tables

Slicer Selected Company:

  • Alpha Corp
  • Beta Inc
  • Delta Group

Slicer Cohort Company:

  • Gamma Ltd
  • Beta Inc
  • Omega Pvt Ltd

Company Sales:

  • Alpha Corp: 100
  • Beta Inc: 200
  • Gamma Ltd: 150
  • Omega Pvt Ltd: 250
  • Zeta LLC: 300

Created a Combined Visual Axis Table

Visual Companies =
DISTINCT (
    UNION (
        SELECTCOLUMNS('Slicer Selected Company', "Company", 'Slicer Selected Company'[Company]),
        SELECTCOLUMNS('Slicer Cohort Company', "Company", 'Slicer Cohort Company'[Company])
    )
)

This merges both slicers into one axis table.

Created a Measure for Filtered Sales

In the Company Sales table, add this measure:

Filtered Sales =
VAR SelectedCompanies = VALUES('Visual Companies'[Company])
RETURN
CALCULATE(
    SUM('Company Sales'[Sales]),
    TREATAS(SelectedCompanies, 'Company Sales'[Company])
)


Built the Visual
Add a Clustered Column Chart
Set - 

X-Axis -  Visual Companies[Company]

Y-Axis (Values) - Filtered Sales (Measure)

Add slicers:
Slicer Selected Company[Company]
Slicer Cohort Company[Company]

The chart now dynamically displays companies selected in either slicer and their corresponding sales, even without direct relationships.

Please find the attached .pbix file for your reference.

Regards,
Sreeteja.

Hi @esingh ,
I hope the information provided above assists you in resolving the issue. If you have any additional questions or concerns, please do not hesitate to contact us. We are here to support you and will be happy to help with any further assistance you may need.

Hi @esingh ,

I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you

 

Hi @v-sshirivolu @FBergamaschi @rohit1991 

The inputs provided helped me collate the approaches and create a solution.

Thanks

 

 

esingh
Helper I
Helper I

Slicer Tables:

CodeNameType Year
1Company AA2025
2Company BA2024
3Company CB2024
4Compnay DB2025
5Compnay EC2024

 

Data Table:

CodeNameType YearSales
1Company AA2025100
2Company BA2024200
3Company CB2024400
4Compnay DB2025500
5Compnay EC2024600

 

Slicer Selected Company: Company A

Cohort Selected Company: Company B and Company D

 

Output: Table

NameType YearSales
Company AA2025100
Company BA2024200
Compnay DB2025500

Thanks for providing the data

 

If I understand correctly you want to create two slicers, each slicer show the company name list of two different tables but both tables have the same content (your slicer table will be loaded twice?), let's call them SlicerTable1 and SlicerTable2

 

Define this Measure

 

Selection Sales =

VAR Selection = 
DISTINCT (
UNION (
VALUES (SlicerTable1[Name]),
VALUES (SlicerTable2[Name])
        )
)
RETURN
CALCULATE(
  SUM('Data Table'[Sales]),
      'Data Table'[Name] IN Selection
)
 
In the output table you put the column Name from the Data Table in the "rows" section of the visual and the Selection Sales in the Values section
 
I am a bit confused on why you are using two different slicers and not a multiselect single slicer?
 

If this helped, please consider giving kudos and mark as a solution

@mein replies or I'll lose your thread

consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

I forgot

Independently on who gave you the best answer, this post should have been published in the DAX section. Would you cosider posting it there? So it is in the right section for other users to benefit from my or anybody else's answer.


We can continue in the DAX section

 

https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/bd-p/DAXCommands

Hi Francesco

We have other visualization where we are comparing cohort (as a group Single value) vs selected companies.

Thanks

 

OK

 

Please give kudos or mark as a solution if myself or others provided you with a solution, possibly after you report in the DAX section

 

Thanks

rohit1991
Super User
Super User

Hi @esingh ,

 

To get your bar chart to only show companies that are selected in either slicer (and not all companies), you’ll want to use a measure instead of a calculated table. Calculated tables (like with UNION) are fixed at data refresh, so they won’t update based on slicer selections.

Here’s the best way: 

  1. Use your regular Company Sales table as the basis for your visual (don’t try to create a union table for the X axis).

  2. Create a measure in the Company Sales table:

ShowCompany =
VAR Selected =
    UNION(
        VALUES('Slicer Selected Company'[Name]),
        VALUES('Slicer Cohort Company'[Name])
    )
RETURN
    IF(
        'Company Sales'[Name] IN Selected,
        1,
        0
    )

Now, your chart will show only the companies picked in either slicer, exactly as you wanted.


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Union in slicer is giving all unique values of the company name.Not selected values in the slicers

FBergamaschi
Solution Sage
Solution Sage

Please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.

 

Need help uploading data? click here

 

Want faster answers? click here

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors