Forum Discussion
pmdci
10 years agoAdvocate V
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...
- 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:
ankitpatira
10 years agoCommunity Champion
pmdci You can make use of RELATED function. It will work since you have relation between two tables.
pmdci
10 years agoAdvocate V
ankitpatira as I mentioned in my original post, I tried it but I only got errors.
- ankitpatira10 years agoCommunity Champion
pmdci what is the error you getting when using RELATED.
- pmdci10 years agoAdvocate V