Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Date column dissapears with relation

Hi, My fact table has a date column. When I make a relation on it with my date table, the fact date column does not show as a date column anymore. I can't use the date functions for that column, for...
  • bcdobbs's avatar
    4 years ago

    By default Power Bi creates hidden date tables in the background that you're referencing in your measure with [DATE].[Year]

    When you create a relationship to a full date table it turns that functionality off. 
    You need to update your measure to use your date table. Assuming your date table is called date and you've marked it as a date table use:

    Count2020= COUNTROWS(FILTER(DIM_FACT, 'Date'[Year] = 2020))

     

    Your DAX would be faster if you did this though:

    Count2020 =
    CALCULATE (
        COUNTROWS(DIM_FACT),
        'Date'[Year] = 2020
    )