Forum Discussion

EugenioProlog's avatar
EugenioProlog
Icon for Helper III rankHelper III
1 year ago
Solved

Creating a fake bar chart category

I have this report that uses my sales_by_salesperson table to plot a bar chart. I also have a table called sales_online with several categories and I want to sum them all into one, as if they were a ...
  • gmsamborn's avatar
    1 year ago

    Hi EugenioProlog 

     

    To accomplish this, I created a calculated table.

    Calculated Table = 
        UNION(
            SELECTCOLUMNS(
                'sales_by_salesperson',
                "_Date", [date],
                "_Salesperson", [salesperson],
                "_Total", [total]
            ),
            SELECTCOLUMNS(
                'sales_online',
                "_Date", [date],
                "_Salesperson", "Online",
                "_Total", [total]
            )
        )

     

    After relating the new table to dim_calendar based on [Date], I created the following measure:

    Sales including Online = 
        SUMX(
            'Calculated Table',
            [_Total]
        )
    

     

    Let me know if you have any questions.

     

    Sales Bar Chart.pbix