Forum Discussion

Irwin's avatar
Irwin
Helper IV
4 years ago
Solved

Related + userelationship ?

Hi Guys, I need to create a calculated column with userelatioship. So far I have made a monthyear column with related refering to my date table.   This works fine and the date is displayed ...
  • Irwin's avatar
    4 years ago

    Okay I managed to solve it with this article:

    https://www.sqlbi.com/articles/userelationship-in-calculated-columns/

     

    Its long and complicated... I didnt understand everything but once I used their measure it worked.

     

    MonthStartDate =
    CALCULATE (
    SELECTEDVALUE ( DimCalendar[MonthYearKey] ),
    CALCULATETABLE(
    'TaskTable(Lots)',
    USERELATIONSHIP ( 'TaskTable(Lots)'[Start Date], 'DimCalendar'[CalendarKey] ),
    REMOVEFILTERS('DimCalendar')
    )
    )
     
    Thanks for your answer amitchandak, I will definately try it out as well.