Forum Discussion

harshadrokade's avatar
harshadrokade
Post Partisan
4 years ago
Solved

Data filter DAX help needed

HI All,

 

I have below table structure. 

I also have slicer as 'Vendor' which is coming from different table as 'Vendorlist' - Vendor column. When I select the Vendor from this slicer, I want to show the bifurcation of service where we have selected vendor as Secondary vendor & Service is Yes. Can you pls help.

 

E.g. In the slicer, If I select ABC4, I want show break up of service being used for that vendor as Sub vendor. So I will be showing a pie chart with Service break up as XYZ1-43%, XYZ2-29%, XYZ3-29%. Will not consider items with Service used? as No in visual.

 

The problem here is that my tables are connected with each other with vendor field but when I select the vendor on slicer, I want to show the data of Secondary vendor on pie chart & not vendors.

 

Table Vendordata-

Client IDVendorSecondary VendorServiceService used?
1ABC1ABC4XYZ1Yes
2ABC1ABC4XYZ1Yes
3ABC1ABC4XYZ1Yes
4ABC1ABC4XYZ2Yes
5ABC1ABC4XYZ2Yes
6ABC4ABC4XYZ3Yes
7ABC5ABC4XYZ3 Yes
8ABC6ABC4XYZ3No
9ABC7ABC4XYZ3No
  • harshadrokade 

     

    Try this:

    Measure =
    CALCULATE(COUNTROWS(Vendordata),Vendordata[Service used?]="Yes",USERELATIONSHIP(Vendordata[Secondary Vendor],Vendorlist[Vendor]))
     
     
    Output:

     

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!
    LinkedIn: 
    www.linkedin.com/in/vahid-dm/

     

     

6 Replies

  • harshadrokade 

     

    Try this:

    Measure =
    CALCULATE(COUNTROWS(Vendordata),Vendordata[Service used?]="Yes",USERELATIONSHIP(Vendordata[Secondary Vendor],Vendorlist[Vendor]))
     
     
    Output:

     

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!
    LinkedIn: 
    www.linkedin.com/in/vahid-dm/

     

     

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        You are welcome.  If my previous reply helped, please mark it as Answer.