Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
Been trying to find a solution for this. I have two tables (A & B below) that are related and want to create a DAX measure that counts the number of records for "Alternate Name" separately from "Customer Name". Currently, "Customer Name" is under the Rows section, and the other columns would be under the Values section. Seems like a fairly simple task, but I just have not been able to solve it. Each formula I have tried comes back with one error or another. Anyone have any ideas?
In the tables below, Table A is the transactions, Table B is the Customer Names, and The Data Visual Table at the bottom gives an example of what I am trying to measure. The column in Red is what I am having trouble with.
Table A | Table B | |||
Customer | Record # | Customer Name | Alternate Name | |
Customer 1 | Record 10 | Customer 1 | Name A | |
Customer 1 | Record 11 | Customer 2 | Name B | |
Customer 2 | Record 14 | Customer 3 | Name C | |
Customer 2 | Record 25 | Customer 4 | Name D | |
Customer 3 | Record 16 | |||
Customer 3 | Record 17 | |||
Customer 3 | Record 21 | |||
Customer 4 | Record 13 | |||
Name A | Record 22 | |||
Name A | Record 24 | |||
Name A | Record 19 | |||
Name B | Record 23 | |||
Name C | Record 20 | |||
Name D | Record 12 | |||
Name D | Record 15 | |||
Name D | Record 18 | |||
Data Table Visual | ||||
Customer | # Customer Name Records | # Alternate Name Records | ||
Customer 1 | 2 | 3 | ||
Customer 2 | 2 | 1 | ||
Customer 3 | 3 | 1 | ||
Customer 4 | 1 | 3 |
Solved! Go to Solution.
HI @ScottR-MT
Try this MEASURE in table B
# Alternate Name Records = CALCULATE ( COUNT ( TableA[Record #] ), FILTER ( ALL ( TableA ), TableA[Customer] = SELECTEDVALUE ( TableB[Alternate Name] ) ) )
Thank you for the reply. This did not work for me, but didn't give me an error this time, but rather no data. If this helps, I am trying to get the number of transactions for a substituted customer name on the same row in my visual as the original customer name. Is there perhaps another formula that can utilize the RELATED command to simplify the calculation?
In the Tbale Visual ...are you using Customers from TAble A?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |