Forum Discussion

MyPowerbi2020's avatar
MyPowerbi2020
Helper IV
5 years ago
Solved

Please explain the result

I was trying to filter out a date table based on a given date , here : DATE(2010,1,15)

The second formula is working , I am not sure why the first one is not.

What I know is FILTER also returns table.

 

1)

 

FILTER(
DimDate,
DATESBETWEEN(
DimDate[FullDateAlternateKey],
DATE(2010,1,15), DATE(2010,1,15)
)
)
 
 
 
2)
CALCULATETABLE(
DimDate,
DATESBETWEEN(
DimDate[FullDateAlternateKey],
DATE(2010,1,15), DATE(2010,1,15)
)
)


  • Hi MyPowerbi2020 ,

    FILTER(<table>,<filter>)  
    PARAMETERS
    Term Definition
    table The table to be filtered. The table can also be an expression that results in a table.
    filter A Boolean expression that is to be evaluated for each row of the table. For example, [Amount] > 0 or [Region] = "France"

    When you use filter return a table ,need a boolean expression ,but the dax datesbetween is return a table ,not a boolean expression.

     

    When I only use the  datesbetween:

     

    Table 2 = DATESBETWEEN(
    DimDate[FullDateAlternateKey],
    DATE(2010,1,15), DATE(2010,1,15)
    )

     

    Refer:

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

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

     

    Did I answer your question? Mark my post as a solution!


    Best Regards

    Lucien

3 Replies