March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I'm using a calculated table (a union of different columns), and then detecting filters applied from a different matrix visual in order to dynamically change the axis of a chart visual.
Since the different values that can be used to filter from one visual to another are in hierarchy, I am using ISFILTERED in order to test whether something is directly filtered as ISCROSSFILTERED will not work as intended.
However, when I change the display name of the field within the visual (i.e. Add the column "CUSTOMER_FULL_NAME" to the visual and then edit the name to be "Customer") then the behaviour changes, apparently the original field is no longer directly filtered?
How can I account for this, or must I not edit the name for ISFILTERED to work?
Code not really required, but here you go:
Table:
Country SR Customer Slicer =
VAR CountryTable = CROSSJOIN(
ROW("Type", "Country"), VALUES(Country[Country]))
VAR SalesRepTable = CROSSJOIN(
ROW("Type", "Sales Rep"), VALUES('Sales Reps'[Sales Rep]))
VAR CustomerTable = CROSSJOIN(
ROW("Type", "Customer"), VALUES('All Customers'[CUSTOMER_FULL_NAME]))
RETURN
FILTER(
UNION(UNION(CountryTable,SalesRepTable), CustomerTable),
NOT ISBLANK([Country])
)
Second column name in table defaults to "Country", so that column is filtered. Column then manually changed to "Key".
Return Measure:
SalesWithCountryRepCustomerHierarchy =
VAR CustomerLevel = ISFILTERED('All Customers'[CUSTOMER_FULL_NAME])
VAR SalesRepLevel = ISFILTERED('Sales Reps'[Sales Rep])
VAR CustomerList = INTERSECT(VALUES('All Customers'[CUSTOMER_FULL_NAME]), VALUES('Country SR Customer Slicer'[Key]))
VAR SalesRepList = INTERSECT(VALUES('Sales Reps'[Sales Rep]), VALUES('Country SR Customer Slicer'[Key]))
VAR CountryList = INTERSECT(VALUES(Country[Country]), VALUES('Country SR Customer Slicer'[Key]))
RETURN
SWITCH(TRUE(),
CustomerLevel,
CALCULATE([Sales],
FILTER('Country SR Customer Slicer', 'Country SR Customer Slicer'[Type] = "Customer"),
TREATAS(CustomerList, 'All Customers'[CUSTOMER_FULL_NAME])
),
SalesRepLevel,
CALCULATE([Sales],
FILTER('Country SR Customer Slicer', 'Country SR Customer Slicer'[Type] = "Sales Rep"),
TREATAS(SalesRepList, 'Sales Reps'[Sales Rep])
),
CALCULATE([Sales],
FILTER('Country SR Customer Slicer', 'Country SR Customer Slicer'[Type] = "Country"),
TREATAS(CountryList, Country[Country])
)
)
@ghaines , create this table as a Var in measure, calculated table and column, can not use slicer value. do that will not work
Are you saying this expression will have no effect?
FILTER('Country SR Customer Slicer', 'Country SR Customer Slicer'[Type] = "Customer")
I do need a calculated table because the key column in the visualisation legend. But knowing that the slicer is not working and that it's just that there are no keys common to country, rep or customer is good to know. Thanks.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
19 | |
19 | |
16 | |
8 | |
5 |
User | Count |
---|---|
36 | |
28 | |
16 | |
16 | |
12 |