Forum Discussion
Applying a WHERE condition in DAX
Hi, I have the below measure which is working perfectly. Now i want to add another condtion from customer table. so customer.type='NEW'
how exactly do I add this to my below query please ? Many Thanks
CurrentReservations =
VAR PrevSunday = TODAY() - WEEKDAY(TODAY(),2)
VAR PrevMonday = PrevSunday - 6
RETURN CALCULATE (COUNTROWS('customer') , FILTER(ALL('Date') , 'Date'[Date] >= PrevMonday && 'Date'[Date] <= PrevSunday) , FILTER(Order, Order[Type] =false() ))
Hello Anonymous ,
you can add it in the Calculate statement:
CurrentReservations = VAR PrevSunday = TODAY() - WEEKDAY( TODAY(), 2 ) VAR PrevMonday = PrevSunday - 6 RETURN CALCULATE( COUNTROWS( 'customer' ), FILTER( ALL( 'Date' ), 'Date'[Date] >= PrevMonday && 'Date'[Date] <= PrevSunday ), FILTER( Order, Order[Type] = FALSE() ), 'customer'[type] = "NEW" )If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
2 Replies
- selimovd
Most Valuable Professional
Hello Anonymous ,
you can add it in the Calculate statement:
CurrentReservations = VAR PrevSunday = TODAY() - WEEKDAY( TODAY(), 2 ) VAR PrevMonday = PrevSunday - 6 RETURN CALCULATE( COUNTROWS( 'customer' ), FILTER( ALL( 'Date' ), 'Date'[Date] >= PrevMonday && 'Date'[Date] <= PrevSunday ), FILTER( Order, Order[Type] = FALSE() ), 'customer'[type] = "NEW" )If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi - AnonymousNot applicable
Sorry I did a typo in the above question. so customer.type IN ('NEW','Existing').
How do i add this filter to my measure please ? Many Thanks