Forum Discussion

pmdci's avatar
pmdci
Advocate V
10 years ago
Solved

DAX: relating a field from another table in a function

Hi,   I created the following DAX calculated column, which I am using across different tables.   =(YEAR(Today())-YEAR(DATEFIELD]))*12+MONTH(Today())-MONTH([DATEFIELD])   This field calculates h...
  • pmdci's avatar
    pmdci
    10 years ago

    Neuro81 and ankitpatira

     

    Sorry for the trouble, but I managed to fix it in the end

     

    =(YEAR(Today())-YEAR(RELATED('Availability Calendar'[Date])))*12+MONTH(Today())-MONTH(RELATED('Availability Calendar'[Date]))

     

    The problem is that I got lost with the number of parenthesis (how lame!) So I deconstructed the formula and use a replace function to make it work.

     

    Wish I could delete this post altogether. Again sorry for wasting your time! :smileysad::smileymad: