Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Get sales per week

Hello,

 

I have a card which should show the sales for the current week, however it says BLANK

 

I created a measure using another measure which calculates the total sales for the current year:

CurrentYearSales = CALCULATE(SUM('POWER BI'[Sales]),YEAR('POWER BI'[Orderdate])=YEAR(TODAY()))

 

Measure used to calculate sales this week sales:

ThisWeekSales = CALCULATE([CurrentYearSales],FILTER('POWER BI','POWER BI'[Weeknr] = WEEKNUM(TODAY(),2)))
 
Can anyone tell me what I'm doing wrong here?
  • Hi   Anonymous 

    Try this:

    ThisWeekSales = CALCULATE( SUM( 'POWER BI'[Sales] ), FILTER( ALL( 'POWER BI' ), 'POWER BI'[Weeknr] = WEEKNUM( TODAY(), 2 ) ) ) 

     

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!


    LinkedIn: www.linkedin.com/in/vahid-dm/

     

     

     

2 Replies

  • Hi   Anonymous 

    Try this:

    ThisWeekSales = CALCULATE( SUM( 'POWER BI'[Sales] ), FILTER( ALL( 'POWER BI' ), 'POWER BI'[Weeknr] = WEEKNUM( TODAY(), 2 ) ) ) 

     

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!


    LinkedIn: www.linkedin.com/in/vahid-dm/

     

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    VahidDMthanks! The formula works. But now the thing is. I use the measure in two different tabs. One with details for store turnover and one for online turnover. Is there a way to make the same measure work for both tabs?