The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
I am trying to create a bar chart, where i want to compare Company (lets say company name - ABC) with its Peer group (this is any selction of companies from the slicer).
I want to have two slicers one for the selection of company name and another slicer for the selection of group of companies, both slicers are from same column.
Is there a way that I can show both the company name and Peer group (based on the slicer selection) on the bar chart on X axis.
The result that i want to acheive is the below image, where the peer group is a selection of group of companies
Thanks for your kind help.
Solved! Go to Solution.
Hi @anwarbi ,
I created a sample pbix file(see the attachment), it include two methods in it.
Method 1: Only create one slicer
Method 2: Create two dimension tables with [Name] field and two slicers
Company1 = VALUES('Table'[Name])
Company2 = VALUES('Table'[Name])
Measure1 =
AVERAGEX (
FILTER ( 'Table', 'Table'[Name] = SELECTEDVALUE ( 'Company1'[Name] ) ),
'Table'[Rating]
)
Measure2 =
AVERAGEX (
FILTER ( 'Table', 'Table'[Name] = SELECTEDVALUE ( 'Company2'[Name] ) ),
'Table'[Rating]
)
Create dimension tables
Best Regards
Hi @anwarbi ,
I created a sample pbix file(see the attachment), it include two methods in it.
Method 1: Only create one slicer
Method 2: Create two dimension tables with [Name] field and two slicers
Company1 = VALUES('Table'[Name])
Company2 = VALUES('Table'[Name])
Measure1 =
AVERAGEX (
FILTER ( 'Table', 'Table'[Name] = SELECTEDVALUE ( 'Company1'[Name] ) ),
'Table'[Rating]
)
Measure2 =
AVERAGEX (
FILTER ( 'Table', 'Table'[Name] = SELECTEDVALUE ( 'Company2'[Name] ) ),
'Table'[Rating]
)
Create dimension tables
Best Regards
Hi,
I have got another query related to this.
When I am applying the below measure to calculate average, the measure is giving me correct results
Hi,
Thanks a lot!
The second method solves the problem, although I needed to use Allselected value instead of Selectedvalue for the filter.
Thanks.
User | Count |
---|---|
65 | |
61 | |
60 | |
53 | |
27 |
User | Count |
---|---|
181 | |
83 | |
68 | |
49 | |
46 |