Forum Discussion

DevadathanK's avatar
DevadathanK
Icon for Resolver I rankResolver I
6 years ago

Translating WEEKS into MONTHS

Hi Community!

<Message deleted>

Thanks for any help!

4 Replies

  • DevadathanK , share the raw data , where we can can see how week, month and year has been used, so that we can suggest a method to split

  • v-xicai's avatar
    v-xicai
    Icon for Community Support rankCommunity Support

    Hi DevadathanK ,

     

    You can create calendar table first, assuming you have created the Holiday table via Enter Data, then create relationships among the calendar table , Data table and Holiday table on date field, keep Cross filter direction as Both.

     

    Table: DateDim = CALENDAR(MIN(Data[DATE]),MAX(Data[DATE]))

     

    Secondly, create column and measure in Data table like DAX below.

     

    Column: IsWorkDay = IF (WEEKDAY(MAX(DateDim[Date]),2)<=5 && COUNTX(RELATEDTABLE(Holiday),1)<1,1,0)
    
    
    Measure:  No. of working days passed = IF(MAX(Data[IsWorkDay])<>0,CALCULATE(COUNTX(FILTER(ALLSELECTED(Data),Data[IsWorkDay]<>0),Data[IsWorkDay]),FILTER(ALLSELECTED(Data),Data[LogDate]<=MAX(Data[LogDate])&& MONTH(Data[LogDate])=MONTH(MAX(Data[LogDate])))),BLANK())
    

    For reference:

    https://community.powerbi.com/t5/Desktop/Calculate-dynamically-No-of-business-days-passed-in-a-month/m-p/747175#M360155

     

    Best Regards,

    Amy 

     

    Community Support Team _ Amy

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • By calculating the number of days present in Hybrid Week, I was able to divide the hours.


    September-October-2020-Calendar-with-Week-Numbers.png


    For October: (Show start week and end week only due to character limit restrictions)