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

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.

Reply
Anonymous
Not applicable

VALUES() for a slicer ignoring other slicers

Hello everyone. 

 

My objective is to be able to use different slicers to control the result of a measure for each month independently. I am going to present a simplyfied version of the problem, but solving this will surely solve the bigger task.

 

I have a table called "Slicers" as this:

Asanchezreyes_0-1645715749829.png
I want to use the selection of indepent slicers for each column


I make a measure called "_test":

Asanchezreyes_1-1645715807300.png
This initially seems to work, as can be seen in this image:

Asanchezreyes_2-1645715867417.png


However, if I select something in the second slicer (different than the value in the first slicer), the value turns BLANK():

Asanchezreyes_3-1645715931370.png

 

The only exception is the selection A,B, which are the only two different values that coexist in the table (see figure 1):

Asanchezreyes_4-1645715981903.png


So my general idea is that the measure itself is worded correctly, but the "intersection" of the slicers creating a null result causes some sort of issue I haven't been able to solve. So far if tried with ALL(), ALLEXCEPT(), REMOVEFILTERS(), KEEPFILTERS(), FILTER(), FILTERS() and different combinations, but to no avail.

 

Could someone shed some light on how to tackle this? I know a possibility would be to create different slicer tables, but we would need 12 (one for each month), and I would like to find an alternative, since I'm sure there must be a way.

Thank you in advance,

Alberto.

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

This is really interesting, the problem is because of the difference between how CALCULATE and SUMMARIZECOLUMNS work with filter arguments. Behind the scenes Power BI is translating your card visual into this DAX query

 DEFINE
  VAR __DS0FilterTable = 
    TREATAS({"A"}, 't1'[Version_January])

  VAR __DS0FilterTable2 = 
    TREATAS({"C"}, 't1'[Version_February])

EVALUATE 
  SUMMARIZECOLUMNS(__DS0FilterTable, __DS0FilterTable2, "v_test", IGNORE('t1'[_test]))

which indeed returns BLANK as the result.

However, passing the same filters into CALCULATE as in 

 CALCULATE( [_test], __DS0FilterTable, __DS0FilterTable2 )

produces the correct result of A, which shows that your measure definition is correct.

Given that your problem is caused by the inner workings of Power BI, and there is no way to change that, I don't think you have any option other than to split your slicers into separate, unconnected tables.

View solution in original post

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

My question is that when you select A in the Version_January slicer, there is only A for you to choose in the Version_February slicer, why do you have D appearing, is it because you put fields in other tables?

vstephenmsft_0-1646119482327.png

 

My suggestion is that using the SELECTEDVALUE function should not be affected by other slicers.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi Stephen.

 

That's because the interaction between the slicers is disabled, I should have mentioned it:

Asanchezreyes_0-1646119987279.png


As for SELECTEDVALUE, I encounter the very same problem:

Asanchezreyes_1-1646120098077.png

 

 

johnt75
Super User
Super User

This is really interesting, the problem is because of the difference between how CALCULATE and SUMMARIZECOLUMNS work with filter arguments. Behind the scenes Power BI is translating your card visual into this DAX query

 DEFINE
  VAR __DS0FilterTable = 
    TREATAS({"A"}, 't1'[Version_January])

  VAR __DS0FilterTable2 = 
    TREATAS({"C"}, 't1'[Version_February])

EVALUATE 
  SUMMARIZECOLUMNS(__DS0FilterTable, __DS0FilterTable2, "v_test", IGNORE('t1'[_test]))

which indeed returns BLANK as the result.

However, passing the same filters into CALCULATE as in 

 CALCULATE( [_test], __DS0FilterTable, __DS0FilterTable2 )

produces the correct result of A, which shows that your measure definition is correct.

Given that your problem is caused by the inner workings of Power BI, and there is no way to change that, I don't think you have any option other than to split your slicers into separate, unconnected tables.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.