Forum Discussion

simrantuli's avatar
simrantuli
Continued Contributor
6 years ago
Solved

Issues in Matrix visual

Hi All,

 

I am facing an issue while trying to show some information in 'Matrix'. 

So, I have below two tables.

'Table' table:

'Mapping' table:

What I want to show in 'Matrix' visual is 'Site' as Row, 'Service' as Column and 'Supplier' as Value.

So, for Value, I have written the below DAX and used it in 'Value' in Matrix but it doesn't show me the correct information.

Supplier_Name = SELECTEDVALUE(Mapping[Supplier])
 
 

So basically, Matrix doesn't show values for 'B3' and 'B4'. And for others too, it doesn't show correct values.

 

Your help would be greatly appreciated 🙂

 

Best Regards

Simran Tuli

 

 

  • simrantuli - I did it like the following:

     

    Measure = 
        VAR __Key = MAX('Table'[#Key_Site_Supplier])
        VAR __Site = MAX('Table (2)'[Site])
    RETURN
        MAXX(FILTER('Table (2)',[#Key_Site_Supplier] = __Key && [Site] = __Site),[Supplier])

     

    PBIX is attached below sig.

     

    Also, you could achieve this just using "First Supplier" if you make your relationship filter direction "Both". Then you don't need the DAX. But, if for some reason you can't do that in your model, the DAX should work.

9 Replies

  • simrantuli's avatar
    simrantuli
    Continued Contributor

    This is the output that I am getting. The values are not showing correct.

     

    • Fowmy's avatar
      Fowmy
      Super User

      simrantuli 

      If you are expecting multiple supplier values to come in the value areas, try the following measure.

      Share data in Excel format or just paste in the reply to box to check further.

      Supplier_Name = 
      CONCATENATEX(
          VALUES(Mapping[Supplier]),
          Mapping[Supplier],
          UNICHAR(10)
      )

       

      ________________________

      Did I answer your question? Mark this post as a solution, this will help others!.

      Click on the Thumbs-Up icon on the right if you like this reply 🙂

      YouTube, LinkedIn

      • simrantuli's avatar
        simrantuli
        Continued Contributor

        Hi Fowmy,

         

        I am not expecting multiple values in Matrix as if you see the data also, there are no multiple suppliers for a single site and service combination.

        Please find below the data.

         

        'Table' table:

         

        Service   #Key_Site_Supplier

        FoodA1##A
        AVA2##B
        FitnessA3##C
        FoodB1##D
        FitnessB2##A
        FoodB3##A
        FitnessB3##A
        AVB3##B
        AVB4##A
        FoodB4##B

         

        'Mapping' table:

         

        Site Supplier #Key_Site_Supplier

        A1AA1##A
        A2BA2##B
        A3CA3##C
        B1DB1##D
        B2AB2##A
        B3AB3##A
        B3BB3##B
        B4AB4##A
        B4BB4##B

         

        Best Regards

        Simran Tuli