Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

How to use calculated columns to get data from Direct Query tables (or any other method)

I have imported tables and Direct Query tables. In one of my imported tables, I need to find if the certain column's values are found in direct query table's column or not. Then I need this informati...
  • v-sgandrathi's avatar
    v-sgandrathi
    1 year ago

    Hi Anonymous,

     

    Create a Disconnected Slicer Table:

    Item Match Filter = DATATABLE(
        "Match Status", STRING,
        {
            {"Found"},
            {"Not Found"}
        })

     

    Create a Measure to Determine Match Status:

    Item Match Status = 
    VAR SelectedStatus = SELECTEDVALUE('Item Match Filter'[Match Status])
    RETURN
        SWITCH(
            SelectedStatus,
            "Found",
                IF(
                    NOT ISBLANK(
                        LOOKUPVALUE(
                            Configuration[Item],
                            Configuration[Item], SELECTEDVALUE(Activity[Item])
                        )),
                    1, 0 ),
            "Not Found",
                IF(
                    ISBLANK(
                        LOOKUPVALUE(
                            Configuration[Item],
                            Configuration[Item], SELECTEDVALUE(Activity[Item])
                        )  ),
                    1, 0),
                  1)

     

    Create a Table visual with the columns Item and Quantity from the Activity table. Apply a visual-level filter using the Item Match Status measure, setting it to 1. Next, add a slicer using 'Item Match Filter'[Match Status] to allow users to filter by "Found" or "Not Found".

     

    I'm Attaching the file for your Reference

     

    Thank you.