Data of Supply and Demand per calendar week

jdhbr 21 Reputation points
2021-02-23T07:52:52.967+00:00

Dear all,

I have a dataset where each row represents a product per customer and in the columns I have the supply per calendar week (CW) and demand per CW.

I would like to visualize the evolution of the supply vs demand throughout the CWs. (barchart with demand and supply side-by-side per calendar week).

I can't seem to figure out how to represent what I want with PowerBI. Can anyone help?

Thanks in advance!

Community Center | Not monitored
{count} votes

Accepted answer
  1. Lz._ 9,016 Reputation points
    2021-02-24T13:19:50.747+00:00

    Hi @jdhbr

    Done with Excel + PQ (works with Power BI Desktop). Assuming Table1 as below

    71567-demo.png

    Power Query code:

    let  
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],  
        ChangedTypes = Table.TransformColumnTypes(Source,  
            {<!-- -->{"Product", type text}} &   
            List.Transform(List.Difference(Table.ColumnNames(Source), {"Product"}),  
                each {_, type number}  
            )  
        ),  
        UnpivotedCWs = Table.UnpivotOtherColumns(ChangedTypes, {"Product"}, "Attribute", "Value"),  
        SplittedAttribute = Table.SplitColumn(UnpivotedCWs, "Attribute",  
            Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false),  
            {"Measure", "Week"}  
        )  
    in  
        SplittedAttribute  
    

    If you need help with Power BI Desktop let me know (not with the Chart though - not my cup of tea :)
    EDIT Corresponding sample avail. here


1 additional answer

Sort by: Most helpful
  1. jdhbr 21 Reputation points
    2021-02-24T10:55:21.82+00:00

    71601-image.png

    Hi @Lz._ , here is a snapshop of some dummy data I've created that resemble mine..

    What I've done to overcome the isse is that I wrote a macro with Excel to separate the table into several sheets, each for a separate calendar week, and then in PowerBI I appended the tables to one another... It is a solution that I can live with for now, but I was wondering if there are any nicer solutions out there..

    Thanks!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.