Forum Discussion
Anonymous
6 years agoNot applicable
Stacked bar chart help to use multiple values
I've 3 tables Table - GroupData (GroupName, MaxCount) WorkData(GroupName, HostName, CategoryName, Count, Date) Calendar(Date, Year) GroupData and WorkData are mapped 1...
- 6 years ago
Hi,
Please try to create this table first:
Table = UNION(DISTINCT('WorkData'[Category]),{{"MaxCount"}})Then try this measure:
Measure = SWITCH(SELECTEDVALUE('Table'[Category]),"MaxCount",MAX('GroupData'[MaxCount]),CALCULATE(SUM(WorkData[Count]),FILTER('WorkData','WorkData'[Category] in DISTINCT('Table'[Category]))))The result shows:
Here is my changed pbix file:
Best Regards,
Giotto Zhi
v-gizhi-msft
6 years agoCommunity Support
Hi,
According to your description, i choose GroupData and WorkData tables to test without calendar table.
Then try to create a calculated column first:
Group&Category = WorkData[GroupName]&"-"&WorkData[Category]Try this measure:
Max Count = CALCULATE(SUM(GroupData[MaxCount]),FILTER(WorkData,WorkData[GroupName] in FILTERS(GroupData[GroupName])))Choose the above column,measure and [Count] as a stacked bar chart, it shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
- Anonymous6 years agoNot applicable
Thank you for you help but requirement has changed and this isn't needed any more. The output i was looking for is as below. Also, legend needs to show the category names
- Anonymous6 years agoNot applicable
- v-gizhi-msft6 years agoCommunity Support
Hi,
Please try to create this table first:
Table = UNION(DISTINCT('WorkData'[Category]),{{"MaxCount"}})Then try this measure:
Measure = SWITCH(SELECTEDVALUE('Table'[Category]),"MaxCount",MAX('GroupData'[MaxCount]),CALCULATE(SUM(WorkData[Count]),FILTER('WorkData','WorkData'[Category] in DISTINCT('Table'[Category]))))The result shows:
Here is my changed pbix file:
Best Regards,
Giotto Zhi