Forum Discussion

MikeFleming's avatar
MikeFleming
Regular Visitor
7 months ago
Solved

FUAM DataSet

I am trying to link the Activities and semantic_models tables using ArtifactId = SemanticModelId   The measure is as follows: Last Refresh Date = VAR CurrentCalc = CALCULATE( MAX('activitie...
  • v-csrikanth's avatar
    7 months ago

    Hi MikeFleming 
    Sorry for the late response.

    The incorrect Last Refresh Date occurs because:

    • TREATAS(VALUES(semantic_models[SemanticModelId])) can return multiple IDs
    • This causes the activities table to be filtered for multiple artifacts
    • MAX(CreationDate) then returns a date from an unrelated refresh

    This is a filter-context ambiguity, not a data issue.

     

    Instead of TREATAS, explicitly filter activities using a single Semantic Model ID via SELECTEDVALUE.

    Last Refresh Date =
    VAR SemanticModelId =
    SELECTEDVALUE ( 'semantic_models'[SemanticModelId] )
    RETURN
    IF (
    NOT ISBLANK ( SemanticModelId ),
    CALCULATE (
    MAX ( 'activities'[CreationDate] ),
    'activities'[Operation] = "RefreshDataset",
    'activities'[ArtifactId] = SemanticModelId
    )
    )


    Let me know if the above mentioned works for you.

    Thanks and regards,
    Cheri Srikanth
    Community Support Team.