Forum Discussion
Calculate code by weeks
- Anonymous7 years ago
HI TiaCamilian ,
You can try to use following measure if it works for your requirement:
SumCode6 = CALCULATE ( COUNT ( MovesConfirm[Code1] ), ALLSELECTED ( 'MovesConfirm' ), VALUES ( 'MovesConfirm'[WeekNumber] ) )Regards,
Xiaoxin Sheng
Thank you for the suggestion. I tried the following:
SumCode6 =
CALCULATE(COUNT(MovesConfirm[Code1]),
FILTER(ALL('Calendar'),
AND('Calendar'[Date] >= TODAY(), 'Calendar'[Date] <= TODAY()+27)))This is counting the Code1 colum by date. I need to calculate by week and needs to be between TODAY() and TODAY()+27
I created a colum with the following code
WeekNumber4 = IF(MovesConfirm[DateWithoutTime] = TODAY(), "WK1") & IF(MovesConfirm[DateWithoutTime] = Today()+1, "WK2")
To put WK1, WK2, WK3 and WK4 I need to do this repeted IF statement by TODAY() and TODAY()+ 1, etc.
to distingush the weeks. I was hopping that once I have this code I can calculate the code1 by WeekNumber4?
This is an exaple of my new data:
Code1 DateWithoutTime SumCode6 WeekNumber
Cof 2/19/2019 4 WK1
En 2/19/2019 1 WK1
Mai 2/19/2019 3 WK1
That SumCode6 is counting by date but I want to count by week.
Any help?
Thank you.
HI TiaCamilian ,
You can try to use following measure if it works for your requirement:
SumCode6 =
CALCULATE (
COUNT ( MovesConfirm[Code1] ),
ALLSELECTED ( 'MovesConfirm' ),
VALUES ( 'MovesConfirm'[WeekNumber] )
)
Regards,
Xiaoxin Sheng
- TiaCamilian7 years agoResolver I
This works.
Thank you