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
robak99
Frequent Visitor

How to synchronize a slicer with a chart

Hello. I want the chart not to show me the values only from 2021. How can I get avoid this problem? This is my report :

 

robak99_0-1633118208581.png

This is my data:

 

robak99_1-1633118269946.pngrobak99_2-1633118301010.png

 

This is measure 'example' : 

example = CALCULATE(
if(SUM(Tabela3[min])=blank(),0,SUM(Tabela3[min])),
FILTER(Tabela4,Tabela4[Id p]=1))

 

How can I correct this code?

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

I propose the following:

example = 
VAR SumMin = CALCULATE ( SUM ( Tabela3[min] ), FILTER ( Tabela4, Tabela4[Id p] = 1 ) )
RETURN
    IF ( ISBLANK ( SumMin ) && NOT ISEMPTY ( Tabela2 ), 0, SumMin )

 

The extra condition that Tablea2 is not empty only replaces blank with zero when it's within the range associated with the selected date.

View solution in original post

7 REPLIES 7
v-xiaoyan-msft
Community Support
Community Support

Hi @robak99 ,

 

Does the replies above solve your problem? If it has been solved, please mark the correct reply as the standard answer to help the other members find it more quickly.Thank you very much for your kind cooperation!

 

Hope it helps,


Community Support Team _ Caitlyn

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

AlexisOlson
Super User
Super User

I propose the following:

example = 
VAR SumMin = CALCULATE ( SUM ( Tabela3[min] ), FILTER ( Tabela4, Tabela4[Id p] = 1 ) )
RETURN
    IF ( ISBLANK ( SumMin ) && NOT ISEMPTY ( Tabela2 ), 0, SumMin )

 

The extra condition that Tablea2 is not empty only replaces blank with zero when it's within the range associated with the selected date.

AlexisOlson
Super User
Super User

You can Edit Interactions such that the slicer does not apply to the visual.

 

In particular, click on Edit Interactions under the Format pane, click on your Year slicer and then click the no impact icon located near the corner of the chart visual.

Sorry, I wrote it bad. I want values only from 2020 when I when i click on 2020 and only from 2021 when i click on 2021. I don't want the rest:

 

robak99_0-1633119716050.png

robak99_1-1633119759123.png

 

I want something like this but with values 0, not NULL (this measure doesn't work as expected):

 

robak99_2-1633119834609.png

 

 

Are you using Tablea2 or Tablea3 for your axis? I think Tablea2 is what you want.

I using Tabela2. I tried Tabela3 but it doesn't work either.

Hmm. What does Tablea1 look like? If it's just {{1,2020},{2,2021}}, then I don't understand why the extra [Id m] are showing up on the chart and I'd have to look at the .pbix to tell what's going on.

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.