Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in LastUsageDateTime calculated columns #29

Open
JamesDBartlett3 opened this issue Dec 7, 2022 · 0 comments
Open

Bug in LastUsageDateTime calculated columns #29

JamesDBartlett3 opened this issue Dec 7, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@JamesDBartlett3
Copy link
Collaborator

The LastUsageDateTime calculated columns are supposed to retrieve the DateTime of the current item's Last Usage from the Activity table, but they only reference the Activity[Time] column, which only contains the time of day. When these calculated columns convert Time to DateTime, the missing Date part defaults to December 30th, 1899:

image

One solution is to replace the Activity[Time] column reference in these calculated column formulas with Activity[Date] & " " & Activity[Time]:

image

LastUsageDateTimeDataset = 
    var v_id = 'Catalog - Dataset'[DatasetId]
    return MAXX(
        FILTER('Activity', Activity[DatasetId] = v_id), 
        Activity[Date] & " " & Activity[Time]
    )
LastUsageDateTimeReport = 
    var v_id = 'Catalog - Report'[ReportId]
    return MAXX(
        FILTER('Activity', Activity[ReportId] = v_id), 
        Activity[Date] & " " & Activity[Time]
    )

I wanted to open the floor for discussion about the best way to solve this problem, and any potential issues that might arise from implementing it the way I've proposed above. If I haven't heard any disagreement with my proposed solution in a few weeks time, I'll make the change myself and submit a PR.

@JamesDBartlett3 JamesDBartlett3 added the bug Something isn't working label Dec 7, 2022
@JamesDBartlett3 JamesDBartlett3 self-assigned this Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant