cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## Stacked bar chart based off measure values

I am trying to create a 100% stacked column based off the results of the measure below: I have created a DistinctCount measure to give me a count of items per Par Location ID(screenshot below). I have tried doing some Calculate/Countrow variations, but I think I'm missing a piece of the puzzle to bring everything together. Would I need to create separate measures for each of these 5 outputs in order to create a stacked bar chart? Currently it just shows the chart as 100% "HOT," and doesn't factor in the other 4 values.

```ITEM STATUS =
IF('2_Bin_Query'[DelPerWeek] = 0, "STALE",
IF('2_Bin_Query'[DaysToTurn] = 0, "SLOW",
IF( '2_Bin_Query'[DaysToTurn] <= [HotSpinCalc],
"HOT",
IF([DaysToTurn] >=[ColdSpinCalc],
"COLD",
"OPTIMAL"
))))```

The table below is used to monitor inventory usage/levels at various locations. I want the stacked column to show percentage of Hot, Cold, Optimal, Stale, Slow.

I was able to do this in Tableau by getting a distinct count of items and colorizing a simple Fixed LOD expression.
3 REPLIES 3
Microsoft

## Re: Stacked bar chart based off measure values

Hi @Anonymous,

Please provide some sample data in source table and the DAX formula for those measures, [DelPerWeek], [DaysToTurn],

[HotSpinCalc] and [ColdSpinCalc].

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

## Re: Stacked bar chart based off measure values

DelPerWeek = MIN('Cart Locations Delivery Schedule'[Delivery Days])
DaysToTurn = [DATERANGE]/[NumOfOrders]
DATERANGE = DATEDIFF(MAX('2_Bin_Query'[Demand Date]), TODAY(), DAY)
ColdSpinCalc = 5*(1+(7/[DelPerWeek])+2)
HotSpinCalc = (1+(7/[DelPerWeek])+2)
NumOfOrders = CALCULATE(COUNT('2_Bin_Query'[Item Number]), ALLEXCEPT('2_Bin_Query', '2_Bin_Query'[Item Number], '2_Bin_Query'[Par Location ID]))

I have attached the source data in an excel table, if you want me to attach the PBIX file instead, let me know. Also, thanks for the article to get answers quickly. I was thinking if there is a way to create a reference table for the outputs of the original IF statement, that might be the way to go. Not sure if that is the best way to go about solving this, so I am open to whatever solutions you may recommend. Let me know if you have any additional questions. Thanks

Anonymous
Not applicable

## Re: Stacked bar chart based off measure values

bump

Announcements

#### New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

#### ‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

#### Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

#### Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

#### Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors