Forum Discussion

kyleldi's avatar
kyleldi
Frequent Visitor
9 years ago
Solved

NETWORKDAYS type function in PowerBI

I have a table (vw_WorkCenterUtilization) and a date column (Work_Date) that I need to calculate the oldest and newest date in the data, and the number of work days within it.  I'm using the FIRSTDAT...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi kyleldi,


    Firstly, create a calendar table in Power BI Desktop following the guide in this blog. Then create a column in the calendar table using the Dax below.

    is work day = SWITCH(WEEKDAY([Date]),1,0,7,0,1)

     

    Secondly, create a measure using the following DAX and create a card visual.

     

    Days= CALCULATE(SUM('Date'[is work day]),
               DATESBETWEEN('Date'[Date], 
                            [OldestDate],
                          [NewestDate]
              ))




     

    Thanks,
    Lydia Zhang