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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Justair07
Resolver I
Resolver I

Display only selected values in stacked bar chart

Hi  everyone,

 

I have a Stacked Combo Chart that shows footage ran by machine (761004, 761013, etc...) stacked by shift (green, blue, red). The purple line represents the target (11,000 per shift) 33,000 for the day. That number increases each day as the week progresses (this is a custom column in my query).

 

Currently when you select a shift, as you can see in the second picture, all of the smachines for that shift become the focus.

 

What I'm trying to accomplish:

Select a shift, the goal will adjust to the shift goal (11,000) not 33,000 and the unselected shifts will go to zero (dissappear). This way the user can select a shift and see if they met their target.

 

I was able to accomplish moving the target based on shirt as you can see in the third picture, but it loses its purpose becasue the shift quantites are not on a flat axis since they are stacked and the height is dependant on the other shifts(see 4th picture for example).

 

Here is what I used for the "SelectedGoal" measure:

SelectedGoal = if(
    SELECTEDVALUE(vShopActivityForReports[ShiftAssigned])*
    SELECTEDVALUE(MachineInfo[Goal])=0,sum(MachineInfo[Goal])*3,
    SELECTEDVALUE(vShopActivityForReports[ShiftAssigned])*
    SELECTEDVALUE(MachineInfo[Goal])
    )

Ideally when a shift is selected, only the machines for that shift will have values and be displayed in the graph and the line will be 11,000 since that is the target for each shift.

 

I know there are other ways to accomplish displaying this information (shift goal met or not) but i really like the idea of using the same visual to show the information in different ways by interacting with it.

Stacked.jpgStacked2.jpgStacked3.jpg

Stacked4.JPG

Thank you,

 

- Justin

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Justair07

I test for long time but can reproduce your situation?

Could you share some data for me so i can reproduce your problem? it is better to share the table structure.

I think maybe we need do something on the table.

 

anyway, try these formula to see if helps.

 

SelectedGoal = if(
    SELECTEDVALUE(vShopActivityForReports[ShiftAssigned])*
    SELECTEDVALUE(MachineInfo[Goal])=0,sum(MachineInfo[Goal])*3,
    SELECTEDVALUE(vShopActivityForReports[ShiftAssigned])*
    MAX(MachineInfo[Goal])
    
SelectedGoal = if(
    HASONEVALUE(vShopActivityForReports[ShiftAssigned]),
    sum(MachineInfo[Goal])*3,
    vShopActivityForReports[ShiftAssigned]*
    MAX(MachineInfo[Goal])

 

 

 

Best Regards

Maggie

 

@v-juanli-msft is it possible to share a Power BI Report on here? That way I can share a sample? I bundled everything in a folder but I don't know how to share it.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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