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,
For instance I have a table like this:
Customer | Cust ID | Type | Sales |
A | 11 | Platinum | 100 |
A | 11 | Gold | 20 |
A | 11 | 300 | |
B | 12 | Silver | 200 |
C | 13 | Gold | 100 |
C | 13 | Silver | 400 |
D | 14 | Platinum | 600 |
Now I need to show in a card or some box the type of Customers:
Eg: If i select a customer name using the select box then ideally my result should be:
Customer | Platinum | Gold | Silver |
A | Yes | Yes | No |
I belive we should use DAX query to get the result. Please advice
Solved! Go to Solution.
You can create three columns.
Platinum =
VAR a=countx(FILTER('data',data[customer]=EARLIER(data[customer])&&data[TYPE]="Platinum"),data[customer])
Return if (a>=1, "Yes","No")
Gold =
VAR a=countx(FILTER('data',data[customer]=EARLIER(data[customer])&&data[TYPE]="Gold"),data[customer])
Return if (a>=1, "Yes","No")
Silver =
VAR a=countx(FILTER('data',data[customer]=EARLIER(data[customer])&&data[TYPE]="Silver"),data[customer])
Return if (a>=1, "Yes","No")
Proud to be a Super User!
You can create three columns.
Platinum =
VAR a=countx(FILTER('data',data[customer]=EARLIER(data[customer])&&data[TYPE]="Platinum"),data[customer])
Return if (a>=1, "Yes","No")
Gold =
VAR a=countx(FILTER('data',data[customer]=EARLIER(data[customer])&&data[TYPE]="Gold"),data[customer])
Return if (a>=1, "Yes","No")
Silver =
VAR a=countx(FILTER('data',data[customer]=EARLIER(data[customer])&&data[TYPE]="Silver"),data[customer])
Return if (a>=1, "Yes","No")
Proud to be a Super User!
@Shaji ,
Try like
Type measure = coalesce(max(Table[Type]),"No")
This solution works fine with one exception.
The result comes as:
Customer Platinum Gold Silver
A Platinum Gold No
instead of
Customer Platinum Gold Silver
A Yes Yes No
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 |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |