Forum Discussion

ja_02's avatar
ja_02
New Member
1 year ago
Solved

Show sub data from parent data from the same data source

Hi, I currently have 2 tables which relation can be shown as below. The tasks table would have 2 type of task : - Main task -> ID will be whole number (1,2,3,etc) - Sub task -> combination of Ma...
  • v-sgandrathi's avatar
    1 year ago

    Hi ja_02,

    Thank you for your question. Based on the scenario you described, where you are working with a Tasks table containing both main tasks and sub-tasks, and you would like the second visual (sub-tasks) to dynamically respond to selections made in the first visual (main tasks), please find below our recommended approach:

    In your model, main tasks use whole numbers (e.g., 1, 2) and sub-tasks use decimals (e.g., 1.1, 1.2), indicating a parent-child structure. Since this isn't explicitly defined, create a calculated column in the Tasks table (e.g., MainTaskID) to extract the parent ID for each sub-task.

    To avoid filtering conflicts between two visuals from the same table, create a disconnected table containing only main task IDs. Use this table in the main task visual.

    Then, define a DAX measure that:

    • Returns 1 when a sub-task's MainTaskID matches the selected main task
    • Returns 1 when no selection is made (to show all sub-tasks)
    • Returns 0 otherwise

    Apply this measure as a visual-level filter in the sub-task table.

    Your TaskAssignee mapping will still work, since we’re not changing relationships just controlling visuals with DAX.

    This setup lets users click a main task and automatically see its related sub-tasks, or see all sub-tasks when nothing is selected achieving both clarity and flexibility.

     

    If this solution worked for you, kindly mark it as Accept as Solution and feel free to give a Kudos, it would be much appreciated!

     

    Kind regards,
    Sahasra
    Customer Support Team.