Forum Discussion

Coolpearl's avatar
Coolpearl
Regular Visitor
1 year ago
Solved

Cannot export data from expected dataset in relationship situation

I have setup relationship between 2 datasets. it is many to one type.  when I export data, I want to export from dataset that has 'many' records, but power bi is exporting from dataset that has 'one...
  • Akash_Varuna's avatar
    1 year ago

    Hi Coolpearl Could you try these please 

    • Use Fields Only from the "Many" Dataset: Ensure your visual includes columns from the "many" dataset, not the "one" dataset.

    • Create a Merged Table: Use Power Query or DAX to merge the "many" and "one" datasets into a single table and use it for your visual.

    • Export Underlying Data: Choose the "Underlying data" export option to ensure raw data from the "many" side is included.

    • Adjust Relationships: Verify your concatenation key (flag + employee_id) is correctly set up and unique on the "one" side.
      Another way would be to create a calculated table in DAX and use that in a vsiual and export that something like this

     

    ExportTable = 
    SELECTCOLUMNS(
        FILTER(
            RELATEDTABLE('ManyDataset'),
            'ManyDataset'[Condition] = TRUE
        ),
        "Employee ID", 'ManyDataset'[EmployeeID],
        "Flag", 'ManyDataset'[Flag],
        "Other Field", 'ManyDataset'[OtherField]
    )

     

    If this post helped please do give a kudos and accept this as a solution
    Thanks In Advance