Forum Discussion

Pacotille's avatar
Pacotille
Regular Visitor
3 years ago

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

  • 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. 

  • Pacotille's avatar
    Pacotille
    Regular 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 :

    Classes123
    114498307.514498307.514498307.5
    1.114319542.514319542.514319542.5
    1.213947776.2513947776.2513947776.3
    1.313774018.7513774018.7513774018.8
    1.413209607.513209607.513209607.5
    1.512365866.2512365866.2512365866.3
    1.610787102.510787102.510787102.5
    1.78924576.258924576.258924576.25
    1.87304201.257304201.257304201.25
    1.9566688056668805666880
    24139023.754139023.754139023.75
    2.12978871.252978871.252978871.25
    2.22107673.752107673.752107673.75
    2.31608771.251608771.251608771.25
    2.41158721.251158721.251158721.25
    2.5745191.25745191.25745191.25
    2.6517865517865517865
    2.7370542.5370542.5370542.5
    2.8218385218385 
    2.9120915120915120915
    38752587525 

     

    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 problem

    Any idea ? i guess my measure is wrong and that's what's causing trouble (i guess with the ALL() )

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Icon for Super User rankSuper User

      Hi,

      I cannot understand your question.  Someone who does will help you.