Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Bins in histogram visual

I have the data in the following format and I need to find the sum of amount for each type and subtract the sum of amount for base from it.  Then, I have to make a histogram with the bins based on t...
  • v-juanli-msft's avatar
    v-juanli-msft
    6 years ago

    Hi Anonymous 

    I create a new table

    Table 2 =
    VAR Table3 =
        SELECTCOLUMNS (
            FILTER (
                SUMMARIZE ( 'Table', 'Table'[type], "TOTAL AMOUNT", SUM ( 'Table'[amount] ) ),
                [type] = "BASE"
            ),
            "type2", [type],
            "TOTAL AMOUNT2", [TOTAL AMOUNT]
        )
    RETURN
        CROSSJOIN (
            FILTER (
                SUMMARIZE (
                    'Table',
                    'Table'[type],
                    "TOTAL AMOUNT", SUM ( 'Table'[amount] ),
                    "count", COUNT ( 'Table'[type] )
                ),
                [type] <> "BASE"
            ),
            Table3
        )
    

    then add columns in the column chart.

     

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.