Forum Discussion

migueldfr's avatar
migueldfr
Helper IV
2 years ago
Solved

Two Bar chart separate with different values

Hi folks, Two Bar chart or same similar  I would like to Sum the amount of sales by store, differentiating by year, but those year do not have to be correlated. That means, the percentage is b...
  • migueldfr's avatar
    2 years ago

    Here, i upload and example: 

    Ç

    I create a table with values and the stores but as you see, the TG% de CANT. is not calullating the values by the total of that colum, it is calcullating by the total of all table...
    I don't want that, I would like to visualize the data for 2022 showing the percertage of that year, and same 2023, but separatly.
    Thank you 

     

  • migueldfr's avatar
    migueldfr
    2 years ago

    I found my issue, the right code was this: 

     

    CategoriaPorcentajeCOUNT (subcate) =
    DIVIDE(
        COUNTX('Table', 1),
        CALCULATE(COUNTX('table', 1), ALLSELECTED('table'[category]))
    )