cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Akshaya_Jain
New Member

Using Gauge Chart with Slicer

 

File Image.png

Hi, I have been trying to use a gauge chart to show the achieved% vs target%. Is there a way I can integrate these two tables (attached is the screenshot) and show data using a gauge chart? Also, I have inserted two slicers in my dashboard, one is showing Major Lines and the other is showing Minor Lines.
Basic idea is, if the user clicks on Property then the gauge chart should show achieved =6.5% and target =7%, and if the user further clicks on Commercial (in another slicer) then the gauge chart should show achieved =4.5% and the target =4%, and if the user further clicks on the USA (in some chart) than gauge chart should show achieved =8% and target =5%
Is there any DAX Measure that I can use to join these 2 tables and achieve what I want to show?

Thank you

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Akshaya_Jain ,

 

Here are the steps you can follow:
1. Power Query – Home – Append Queries -- Append Queries as new.

vyangliumsft_5-1676263521341.png

2. Select [Achieved Performance] and [Target] – Transform – Unpivot Columns.

vyangliumsft_1-1676263444038.png

Result:

vyangliumsft_4-1676263508743.png

3. Create measure.

Measure =
SWITCH(
    TRUE(),
    HASONEVALUE('Append1'[Major Line])&&NOT(HASONEVALUE('Append1'[Minor Line]))&&NOT(HASONEFILTER('Append1'[Country])),
SUMX(
    FILTER(ALLSELECTED('Append1'),
    'Append1'[Attribute]=MAX('Append1'[Attribute])&&'Append1'[Major Line]=MAX('Append1'[Major Line])&&'Append1'[Minor Line]=BLANK()&&'Append1'[Country]=BLANK()),
    [Value])
    ,
    HASONEVALUE('Append1'[Major Line])&&HASONEVALUE('Append1'[Minor Line])&&NOT(HASONEFILTER('Append1'[Country])),
    SUMX(
    FILTER(ALLSELECTED('Append1'),
    'Append1'[Attribute]=MAX('Append1'[Attribute])&&'Append1'[Major Line]=MAX('Append1'[Major Line])&&'Append1'[Minor Line]=MAX('Append1'[Minor Line])&&'Append1'[Country]=BLANK()),
    [Value]),
    HASONEVALUE('Append1'[Major Line])&&HASONEVALUE('Append1'[Minor Line])&&HASONEFILTER('Append1'[Country]), SUMX(
    FILTER(ALLSELECTED('Append1'),
    'Append1'[Attribute]=MAX('Append1'[Attribute])&&'Append1'[Major Line]=MAX('Append1'[Major Line])&&'Append1'[Minor Line]=MAX('Append1'[Minor Line])&&'Append1'[Country]=MAX('Append1'[Country])),
    [Value]))

4. Result:

vyangliumsft_3-1676263444041.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @Akshaya_Jain ,

 

Here are the steps you can follow:
1. Power Query – Home – Append Queries -- Append Queries as new.

vyangliumsft_5-1676263521341.png

2. Select [Achieved Performance] and [Target] – Transform – Unpivot Columns.

vyangliumsft_1-1676263444038.png

Result:

vyangliumsft_4-1676263508743.png

3. Create measure.

Measure =
SWITCH(
    TRUE(),
    HASONEVALUE('Append1'[Major Line])&&NOT(HASONEVALUE('Append1'[Minor Line]))&&NOT(HASONEFILTER('Append1'[Country])),
SUMX(
    FILTER(ALLSELECTED('Append1'),
    'Append1'[Attribute]=MAX('Append1'[Attribute])&&'Append1'[Major Line]=MAX('Append1'[Major Line])&&'Append1'[Minor Line]=BLANK()&&'Append1'[Country]=BLANK()),
    [Value])
    ,
    HASONEVALUE('Append1'[Major Line])&&HASONEVALUE('Append1'[Minor Line])&&NOT(HASONEFILTER('Append1'[Country])),
    SUMX(
    FILTER(ALLSELECTED('Append1'),
    'Append1'[Attribute]=MAX('Append1'[Attribute])&&'Append1'[Major Line]=MAX('Append1'[Major Line])&&'Append1'[Minor Line]=MAX('Append1'[Minor Line])&&'Append1'[Country]=BLANK()),
    [Value]),
    HASONEVALUE('Append1'[Major Line])&&HASONEVALUE('Append1'[Minor Line])&&HASONEFILTER('Append1'[Country]), SUMX(
    FILTER(ALLSELECTED('Append1'),
    'Append1'[Attribute]=MAX('Append1'[Attribute])&&'Append1'[Major Line]=MAX('Append1'[Major Line])&&'Append1'[Minor Line]=MAX('Append1'[Minor Line])&&'Append1'[Country]=MAX('Append1'[Country])),
    [Value]))

4. Result:

vyangliumsft_3-1676263444041.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors