Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Calculate Syntax

Hi,

 

Could somebody please help me with my syntax? The first part works fine, but the Bank Holiday part won't seem to count properly.

 

I want it to look at all start dates and if it lands on a date that is in the bank holiday table, then display 0.

 

 

IF( MAX('Booking Scenarios'[New Start Date]) = MAX('Booking Scenarios'[New End Date])

&&

CALCULATE(COUNT([New Start Date]), FILTER('Bank Holidays', 'Bank Holidays'[Date] < 1)),1,0)

  • Anonymous 

    Try like: (

    Replace Table and Column names

    Measure:
    
    COUNTROWS(
        INTERSECT(VALUES('Table1'[Date]),VALUES('Table2'[DATE]))
    )

     

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    I accept KUDOS ☺

    YouTube | LinkedIn

4 Replies

  • Anonymous , have flag that 1 on back holiday 'and try like

     

    if(CALCULATE(COUNT([New Start Date]), FILTER('Bank Holidays', 'Bank Holidays'[Flag] = 1)) >=1,1,0)

    or

    if(CALCULATE(COUNT([New Start Date]), FILTER('Bank Holidays', 'Bank Holidays'[Flag] = 1)) >=1,1,0) +0

  • Anonymous 

    Try like: (

    Replace Table and Column names

    Measure:
    
    COUNTROWS(
        INTERSECT(VALUES('Table1'[Date]),VALUES('Table2'[DATE]))
    )

     

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    I accept KUDOS ☺

    YouTube | LinkedIn

      • Fowmy's avatar
        Fowmy
        Super User

        Anonymous 

        You are welcome!

        ________________________

        Did I answer your question? Mark this post as a solution, this will help others!.

        I accept KUDOS 🙂

        YouTube | LinkedIn