Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Visualize on chart based on various columns

I have this dataset: 

 

Business_idKPI_1KPI_2
00000101
00000210
00000310
00000400
00000500
00000601
00000711
00000800
00000910
00001010
00001101
00001200
00001310
00001400
00001511
00001600
00001711
00001810
00001901
00002000

 

and I would like to visualize it on a chart that the X axis will be the column "KPI 1" and "KPI 2" and so on and Y axis will be the volume (count) of the related KPI, something like this: 

 

What is the best way to do it? 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  Anonymous ,

     

    Here are the steps you can follow:

    1. Create calculated table.

    Table 2 =
    UNION(
    SELECTCOLUMNS(
        'Table',"Business_id",[Business_id],"KPI","kpI_1","Value",[KPI_1]),
    SELECTCOLUMNS(
        'Table',"Business_id",[Business_id],"KPI","kpI_2","Value",[KPI_2]))

    2. Result:

     

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous ,

     

    Here are the steps you can follow:

    1. Create calculated table.

    Table 2 =
    UNION(
    SELECTCOLUMNS(
        'Table',"Business_id",[Business_id],"KPI","kpI_1","Value",[KPI_1]),
    SELECTCOLUMNS(
        'Table',"Business_id",[Business_id],"KPI","kpI_2","Value",[KPI_2]))

    2. Result:

     

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous 

    One approach to achive this is by
    1) Transform your table by unpivotting the columns to rows
    2) Use a regular Column chart visual to obtain the desired visual

    The transformation can be achived by following the example here: Unpiot columns
    Unpivot so that you have three columns:
    - Business_id
    - Attribute (rename to KPI)
    - Value
    , as illustrated below.

     

    Based on the transformed table, you can obtain the desired visual by using a column visual.
    Set
    y-axis= Values
    x-acis= Attribute (or KPI if you have renamed it)

    Hope this helps.

    Kind regards!

    Consider accepting proposed answer as solution if it solved your problem.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous, 

      First of all thanks for the reply!

      That was my first thought as well, the unpivoting, but since I'm having other tables in the model, it will break my model :\, is there any other solution like to create some kind of aux table with the KPI names in it? 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Ok. Im not sure how to solve your issue without the use of unpivotting.
    (note I am not an expert!)

    Here is a similar question marked as solved:
    Combine multiple measures in single bar chart 
    using either
    - Custom visual "Side by Side Bar Chart(Standard)" from PBIVizEdit.com
    - 2 Measures + Field parameter

    Hope the linked post or other user helps you solve the problem.

    Kind regards