Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

How to change filters behavior?

I have the following table:

 

Seller        Client       Value

TomClient_17227
TomClient_39974
DicskClient_23098
DicskClient_33667

 

Like you can notice, the Client_1 is Tom's client, Client_2 is Dicsk's client and Client_3 is a client from both sellers. I'm using this data to create a matrix and a simple filter, like this:

 

image.png

 

 

 

Using the filters I get this:

image.png

 

 

 

But I want something different from that. I want that my filter behaves like this:

image.png

 

 

 

Is it possible?  If yes, how can I do this?

 

 

 

1 ACCEPTED SOLUTION
v-huizhn-msft
Employee
Employee

Hi @Anonymous,

I try to reproduce your scenario, please review the following steps.

1. Create a new table including Clients by "New Table" under Modeling on Home page. Please notice there is no relationship between New Table and your resource table.

1.PNG 2.PNG

2. Create measure using the formula.

new-value = VAR Client=IF(ISFILTERED(Table1[Client]),CALCULATE(FIRSTNONBLANK(Table1[Client],Table1[Client]),ALLSELECTED(Table1)),BLANK())
RETURN IF(ISBLANK(Client),SUM(Test[Value]),IF(FIRSTNONBLANK(Test[Client],Test[Client])=Client,SUM(Test[Value]),"Not a Client"))

3. Create a slicer including Table1[Client] and a table visual to display the result.

3.png4.PNG6.PNG7.PNG
We are unable to get The total row, because the "Not a Client" is text type, which can not be calculated. Please download the attachment file to test.

Best Regards,
Angelia

View solution in original post

2 REPLIES 2
v-huizhn-msft
Employee
Employee

Hi @Anonymous,

I try to reproduce your scenario, please review the following steps.

1. Create a new table including Clients by "New Table" under Modeling on Home page. Please notice there is no relationship between New Table and your resource table.

1.PNG 2.PNG

2. Create measure using the formula.

new-value = VAR Client=IF(ISFILTERED(Table1[Client]),CALCULATE(FIRSTNONBLANK(Table1[Client],Table1[Client]),ALLSELECTED(Table1)),BLANK())
RETURN IF(ISBLANK(Client),SUM(Test[Value]),IF(FIRSTNONBLANK(Test[Client],Test[Client])=Client,SUM(Test[Value]),"Not a Client"))

3. Create a slicer including Table1[Client] and a table visual to display the result.

3.png4.PNG6.PNG7.PNG
We are unable to get The total row, because the "Not a Client" is text type, which can not be calculated. Please download the attachment file to test.

Best Regards,
Angelia

Anonymous
Not applicable

Perfect, @v-huizhn-msft. I thought that was impossible to calculate the total. I will change the "Not a Client" to zero. So I can calculate de grand total. Thank you.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.