Forum Discussion
Legend problem on cumulative bar chart
hey everyone,
I'm encountering an issue on a cumulative bar chart i'im trying to make.
I have to represent tonnage cumulation by chemical classes (0-1, 1.1-1.2 ....) and i've already made those.
I calculated a measure to plot tonnage which is :
Cumulalt = CALCULATE( SUM(Table[Tons]),
FILTER( ALL(Table), MIN(Table[Classes]) <= Table[Classes])
)
When i'm plotting it, it looks like this :
This is alright, but when i decide to add a legend, here it's a product classification which each line in my date source have, it goes like this :
The problem is that legend doesn't seem to discriminate my different products, it just stack 3 times the same value (~15M max x 3).
Any one have an idea ? thanks in advance !
4 Replies
- Ashish_Mathur
Super User
Hi,
Share some data to work with, explain the question and show the expected result in a simple Table format. From the Table, we can build any visual we want.
- PacotilleRegular Visitor
Well for the data set, each line represent 1 volume entity with a lot of attributes. Here what's useful for my visual are those attributes :
- [Classif] : it contains1 of those 3 values : 1/2/3. This one will have to be use to apply a legend on the stacked bar chart
- [Tons] : it contains the mass of the sample, it can have random values
- [Analyse] : it contains the value of the element analysed in this sample, it have a a value range [0.00 - 6.00]
- [Classes] : Classification made with [Analyse], it goes 0.1 on 0.1.
I can't put here a sample data because my csv contain ~1M lines and a random sample won't be representative.
Currently the problem can be see with a matrix display :
Classes 1 2 3 1 14498307.5 14498307.5 14498307.5 1.1 14319542.5 14319542.5 14319542.5 1.2 13947776.25 13947776.25 13947776.3 1.3 13774018.75 13774018.75 13774018.8 1.4 13209607.5 13209607.5 13209607.5 1.5 12365866.25 12365866.25 12365866.3 1.6 10787102.5 10787102.5 10787102.5 1.7 8924576.25 8924576.25 8924576.25 1.8 7304201.25 7304201.25 7304201.25 1.9 5666880 5666880 5666880 2 4139023.75 4139023.75 4139023.75 2.1 2978871.25 2978871.25 2978871.25 2.2 2107673.75 2107673.75 2107673.75 2.3 1608771.25 1608771.25 1608771.25 2.4 1158721.25 1158721.25 1158721.25 2.5 745191.25 745191.25 745191.25 2.6 517865 517865 517865 2.7 370542.5 370542.5 370542.5 2.8 218385 218385 2.9 120915 120915 120915 3 87525 87525 My cumulative measure (Cumulalt) (as visible above) give me the same [Tons] for each [Classif] which i know it's false.
In consequences, my cumulative bar chart can't have this legend. That's the problemAny idea ? i guess my measure is wrong and that's what's causing trouble (i guess with the ALL() )
- Ashish_Mathur
Super User
Hi,
I cannot understand your question. Someone who does will help you.
- ashuaswinireddy
Helper I
I am facing same problem, Please let me know if you are able to resolve it