Forum Discussion

DeBIe's avatar
DeBIe
Post Partisan
3 years ago
Solved

How to filter by two columns?

Hey all,   I'm not sure how to built the following customer requirement.   In my report I have companies and company codes. Every month our customer will send us an Excel-file with company codes ...
  • johnt75's avatar
    3 years ago

    You need to tweak the model. Firstly, get all the salespeople into one column by opening power query and selecting the company ID and company name columns from the excel file then unpivot other columns. rename the value column to salesperson and delete the attribute column as you don't need it.

    You then need to create a table which contains the distinct salespeople. You can either do this in power query or in DAX.

    You can now use the table from excel as a bridge between the companies and the salespeople, and link it your fact table.

    See the attached PBIX for a sample.

    You might also find https://www.sqlbi.com/articles/different-options-to-model-many-to-many-relationships-in-power-bi-and-tabular/ from SQLBI useful.