Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Measure Dax Help

    Is it possible to add a a filter in the following formula based on a calculated column? I need to exclude every number 7 in the calculation from the calendar table which it means weekends.   ...
  • v-lili6-msft's avatar
    v-lili6-msft
    6 years ago

    hi Anonymous 

    WEEKDAY(<date>, <return_type>)

    add a parameter in the formula

    return_type A number that determines the Return value:

    Return type: 1, week begins on Sunday (1) and ends on Saturday (7). numbered 1 through 7.

    Return type: 2, week begins on Monday (1) and ends on Sunday (7).

    Return type: 3, week begins on Monday (0) and ends on Sunday (6).numbered 1 through 7.

    https://docs.microsoft.com/en-us/dax/weekday-function-dax

    Then adjust the formula as below:

    CALCULATE(COUNTROWS(FILTER(ALLSELECTED(PBI),[WEEKDAY]<6)))

     

    If you still have the problem, please share a simple sample pbix file, and your expected output.

     

    Regards,

    Lin