Forum Discussion

Saxon202202's avatar
Saxon202202
Icon for Helper III rankHelper III
3 years ago

Min and max based in-between two tables

Hi,

I have two tables are Data and Report.
In data table contain the following columns are Item, country code, sale qty.

In report table contain the following columns are item and project code.

In both tables the item column contains duplicate entry. Data and report tables are many to many relationships.

I want country code and sale qty according to the item into report table.

Note:

The same item has two different country code are ADMK & DMK. If same item has two different country code, then DMK is first concern and ADMK is second concern. I want unique code against each item within the table.

The same item has different sale qty or same qty according to the country code.

I am looking for measure to achieve the result.

https://www.dropbox.com/s/d2siyuqqwaklhv4/14-02-2023.pbix?dl=0

8 Replies

  • smpa01's avatar
    smpa01
    Icon for Community Champion rankCommunity Champion

    Saxon202202  does this measure work when you drop it on DATA

    measure= maxx(relatetable('fact'), 'fact'[countryCode]))
      • smpa01's avatar
        smpa01
        Icon for Community Champion rankCommunity Champion

        Many to many is not best practice but I will leave arguing for that portion and simply going to assume that you have a business case.

         

        I refrain from working with many to many but I can see that it works with an indirect relationship without a USERELATIONSHIP callback