Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

SELECT MAX(Date) FROM Source WHERE {Reference_Column] IS NOT NULL

How can I accomplish the above T-SQL statement in Power BI?   I have a table with 4 Columns (Date, Name, Age, Gender) to keep track of who led which training session by date (thats obviously not th...
  • Anonymous's avatar
    Anonymous
    8 years ago

    For anyone with the same issue.

     

    I ended up putting an IF statement into a custom column on the table which checks to see if my reference column has a value, if so it is populated with the corresponding date in that row, if not it is populated with null. After that I used a MAX() function in a measure to get the latest available date from my new column and used that measure in a visual level filter.

     

    It feels like a long way to go for SELECT ColA FROM Table1 WHERE ColB IS NOT NULL but it had the desired effect. If anyone knows a better solution or can give me some insight I am missing I would be grateful.

     

    Thanks