cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
erhan_79
Post Prodigy
Post Prodigy

Chart Help

Hi there , 

 

I have a data as below ;

 

Capture1.PNG

When i create a chart on power bi , datas are showed together based on months as below

 

Capture3.PNG

 

But i want to show datas as below based on their names groupped first then based on month , could you pls telll me how can i manage below seem on power bi ... thanks in advance 

 

Capture2.PNG

1 ACCEPTED SOLUTION
SeanMcLarty
Advocate I
Advocate I

I was hoping Field Parameters could be used to quickly solve this but the result wasn't quite what you requested.  Instead I put your Categories into a table and added a measure to extract the values from your table.

1. Category table (DAX), Seq should be used as sorting column:

Categories = DATATABLE(
    "Category", STRING,
    "Seq", INTEGER,
    {
        {"Total Sales", 1},
        {"Branch 1 Sales", 2},
        {"Branch 2 Sales", 3},
        {"Total Order Qty", 4},
        {"Total Delivery", 5},
        {"File Qty", 6}
    }
)

2. Measure (DAX):

Measure = SWITCH(SELECTEDVALUE(Categories[Category]),
    "Total Sales", SUM('Table'[Total Sales]),
    "Branch 1 Sales", SUM('Table'[Branch 1 Sales]),
    "Branch 2 Sales", SUM('Table'[Branch 2 Sales]),
    "Total Order Qty", SUM('Table'[Total Order Qty]),
    "Total Delivery", SUM('Table'[Total Delivery]),
    "File Qty", SUM('Table'[File Qty])
)

3. Use Clustered Column Chart visual with 'Categories'[Category] as x-axis, 'Categories'[Measure] as y-axis and 'Table'[Month] as legend.  
image.png

View solution in original post

2 REPLIES 2
SeanMcLarty
Advocate I
Advocate I

I was hoping Field Parameters could be used to quickly solve this but the result wasn't quite what you requested.  Instead I put your Categories into a table and added a measure to extract the values from your table.

1. Category table (DAX), Seq should be used as sorting column:

Categories = DATATABLE(
    "Category", STRING,
    "Seq", INTEGER,
    {
        {"Total Sales", 1},
        {"Branch 1 Sales", 2},
        {"Branch 2 Sales", 3},
        {"Total Order Qty", 4},
        {"Total Delivery", 5},
        {"File Qty", 6}
    }
)

2. Measure (DAX):

Measure = SWITCH(SELECTEDVALUE(Categories[Category]),
    "Total Sales", SUM('Table'[Total Sales]),
    "Branch 1 Sales", SUM('Table'[Branch 1 Sales]),
    "Branch 2 Sales", SUM('Table'[Branch 2 Sales]),
    "Total Order Qty", SUM('Table'[Total Order Qty]),
    "Total Delivery", SUM('Table'[Total Delivery]),
    "File Qty", SUM('Table'[File Qty])
)

3. Use Clustered Column Chart visual with 'Categories'[Category] as x-axis, 'Categories'[Measure] as y-axis and 'Table'[Month] as legend.  
image.png

HotChilli
Super User
Super User

In Power Query, if you select the first column (Date?) and choose Unpivot other columns, you will get 3 columns that can be pulled on to a column chart to get what you want

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors