Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Compare day on day per week

In my power bi dataset, I have an orders table with order id column. I want to show a report where in I compare the total orders per day of last week monday to this week monday, tuesday to tuesday so on for the entire week. I was able to achive the cumulative order count for week on week comparison with relative week i.e present week being 0 and last week being -1. But I want to further drill down and show day on day of last week vs current week. I am attaching a visual below with what I want to achive.

I used the dax 

LastWeekOrderCount =
CALCULATE(
    COUNT('Orders'[orderid]),
    'Orders'[RelativeWeekNumber] = -1
) to calculate last week order count and 
ThisWeekOrderCount =
CALCULATE(
    COUNT('Orders'[orderid]),
    'Orders'[RelativeWeekNumber] = 0
) by using the relative week number column which I derived with extract week function in sql. 
I also have total count per day but I want to plot it as a comparison between two bars as I mentioned in the above pic, how can I achive it ?  Also in terms of choosing a visual and plotting it which one is suitable?
amitchandak Ashish_Mathur 

2 Replies

  • I made a calendar table.

     

    Step 1: I made a calendar table.

     

     

     

    Year hierarchy

     

    Step 2: I made a relationship.

     

    Step 3: I made some visuals.

     

    Step 4: I did drilldown.

     

    As my Power BI version is Japanese, days of week are Japanese.

    I think when your Power BI version is English, days of week may be English.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you, I was able to achive the visuals in the same way.