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 Everyone,
I'm after some help with slicers.
I have two slicers: 'Customer' & 'Subscription'.
I have a Card visual which displays the Customer name(s) selected in the Customer slicer. What I want to be able to do is have the Customer name showing when only their Subscription is selected, without selecting from the Customer Slicer (one sub per customer).
I have the following DAX for selecting the customers:
Customers =
I'm wonderin if the DAX can be amended to accomodate what I'm wanting to do?
I've tried changing the 'VALUES' to 'ALLSELECTED' but it doesn't work.
Unfortunately I can't provide a pbix file.
As always, your help is most appreciated and thank you in advance.
Cheers
Ian.
Solved! Go to Solution.
If I understood right, You need sth like this using SWITCH to handle different cases:
SWITCH (
TRUE (),
NOT ( ISFILTERED ( 'Table'[Subscription] ) )
&& NOT ( ISFILTERED ( 'Table'[CustomerName] ) ), "All Customers",
HASONEVALUE ( 'Table'[Subscription] )
&& NOT ( ISFILTERED ( 'Table'[CustomerName] ) ), VALUES ( 'Table'[CustomerName] ),
HASONEVALUE ( 'Table'[CustomerName] )
&& NOT ( ISFILTERED ( 'Table'[Subscription] ) ), VALUES ( 'Table'[CustomerName] ),
ISFILTERED ( 'Table'[Subscription] )
&& HASONEVALUE ( 'Table'[Subscription] ) = FALSE (), CONCATENATEX ( VALUES ( 'Table'[CustomerName] ), 'Table'[CustomerName], ", " ),
ISFILTERED ( 'Table'[CustomerName] )
&& HASONEVALUE ( 'Table'[CustomerName] ) = FALSE (), CONCATENATEX ( VALUES ( 'Table'[CustomerName] ), 'Table'[CustomerName], ", " ),
CONCATENATEX ( VALUES ( 'Table'[CustomerName] ), 'Table'[CustomerName], ", " )
)
Now the logic is clear. Based on your need you can edit it easily.
It helped? Mark it as an accepted solution.
Regards,
Loran
Hi @Nerf_Herder ,
Both name and subscription are in the same table?
You can get by a little bit change as below:
Customers =
IF (
NOT ( ISFILTERED ( 'Table'[Subscription] ) ),
"All Customers",
IF (
HASONEVALUE ( 'Table'[Subscription] ),
VALUES ( 'Table'[CustomerName] ),
CONCATENATEX ( VALUES ( 'Table'[CustomerName] ), 'Table'[CustomerName], ", " )
)
)
It helped? Mark it as an accepted solution.
Regards,
Loran
Hi @MohammadLoran25,
Thank you for your help here, that worked for the Subscription slicer. The issue is I still need the Customer name slicer to work on the card. Do you know if that can be done?
To answer your question, yes the customer name and subscription is all in one table.
Cheers
Ian.
If I understood right, You need sth like this using SWITCH to handle different cases:
SWITCH (
TRUE (),
NOT ( ISFILTERED ( 'Table'[Subscription] ) )
&& NOT ( ISFILTERED ( 'Table'[CustomerName] ) ), "All Customers",
HASONEVALUE ( 'Table'[Subscription] )
&& NOT ( ISFILTERED ( 'Table'[CustomerName] ) ), VALUES ( 'Table'[CustomerName] ),
HASONEVALUE ( 'Table'[CustomerName] )
&& NOT ( ISFILTERED ( 'Table'[Subscription] ) ), VALUES ( 'Table'[CustomerName] ),
ISFILTERED ( 'Table'[Subscription] )
&& HASONEVALUE ( 'Table'[Subscription] ) = FALSE (), CONCATENATEX ( VALUES ( 'Table'[CustomerName] ), 'Table'[CustomerName], ", " ),
ISFILTERED ( 'Table'[CustomerName] )
&& HASONEVALUE ( 'Table'[CustomerName] ) = FALSE (), CONCATENATEX ( VALUES ( 'Table'[CustomerName] ), 'Table'[CustomerName], ", " ),
CONCATENATEX ( VALUES ( 'Table'[CustomerName] ), 'Table'[CustomerName], ", " )
)
Now the logic is clear. Based on your need you can edit it easily.
It helped? Mark it as an accepted solution.
Regards,
Loran
Wow! Honestly that's amazing! I can't thank you enough. That worked exactly as I want it to!
Thank you!!
Ian.
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 |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |