Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
pacifist
Helper II
Helper II

DAX to pull related table artifact's NAME based on TYPE

Hi,

 

struggling with DAX, as everytone else 😉

 

Imagine having a single table of activities for each artifact type ... looks like this

Activity

ArtifactType

ArtifactId
ViewReportReport1
ViewReportReport1
DeleteReportReport2
UpdateDatasetDataset1
CreateDataflowDataflow1

 

and then there are 3 different tables for each artifact type

Reports:

ReportIdReportName
1ReportA
2ReportB
......

 

Datasets

DatasetIdDatasetName
1DatasetA
......


Dataflows:

DaflowIdDataflowName
1DataflowA
...

...

 

All table have their relationships setup with the activity table, and are INACTIVE.

Now, what would the DAX look like for the measure that will return the related artifact's NAME in the ACTIVITY_TABLE? 
e.g.:

ActivityArtifactTypeArtifactIdName
ViewReportReport1ReportA
ViewReportReport1ReportA
DeleteReportReport2ReportB
UpdateDatasetDataset1DatasetA
CreateDataflowDataflow1DataflowA


Thank you!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @pacifist 
Please try the following calculated column

Name =
SWITCH (
    Activities[ArtifactType],
    "Report",
        MAXX (
            FILTER ( Reports, Reports[ReportId] = Activities[ArtifactId] ),
            Reports[ReportName]
        ),
    "Dataset",
        MAXX (
            FILTER ( Reports, Reports[DatasetId] = Activities[ArtifactId] ),
            Reports[DatasetName]
        ),
    "Dataflow",
        MAXX (
            FILTER ( Reports, Reports[DataflowId] = Activities[ArtifactId] ),
            Reports[DataflowName]
        )
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @pacifist 
Please try the following calculated column

Name =
SWITCH (
    Activities[ArtifactType],
    "Report",
        MAXX (
            FILTER ( Reports, Reports[ReportId] = Activities[ArtifactId] ),
            Reports[ReportName]
        ),
    "Dataset",
        MAXX (
            FILTER ( Reports, Reports[DatasetId] = Activities[ArtifactId] ),
            Reports[DatasetName]
        ),
    "Dataflow",
        MAXX (
            FILTER ( Reports, Reports[DataflowId] = Activities[ArtifactId] ),
            Reports[DataflowName]
        )
)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.