Forum Discussion
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 ID | Vendor | Secondary Vendor | Service | Service used? |
| 1 | ABC1 | ABC4 | XYZ1 | Yes |
| 2 | ABC1 | ABC4 | XYZ1 | Yes |
| 3 | ABC1 | ABC4 | XYZ1 | Yes |
| 4 | ABC1 | ABC4 | XYZ2 | Yes |
| 5 | ABC1 | ABC4 | XYZ2 | Yes |
| 6 | ABC4 | ABC4 | XYZ3 | Yes |
| 7 | ABC5 | ABC4 | XYZ3 | Yes |
| 8 | ABC6 | ABC4 | XYZ3 | No |
| 9 | ABC7 | ABC4 | XYZ3 | No |
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/YUO are Pro.Thanks a lot
6 Replies
- VahidDMSuper User
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/- harshadrokadePost Partisan
Thanks a lot sir
- Ashish_MathurSuper User
You are welcome.
- Ashish_MathurSuper User
- harshadrokadePost Partisan
YUO are Pro.Thanks a lot
- Ashish_MathurSuper User
You are welcome. If my previous reply helped, please mark it as Answer.