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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Display different monthly data depending on the month using SWITCH

Hi all,

 

I am facing a problem using SWITCH function.

 

Here is the deal :
I build a budget 1 (B1) for monthly sales for the full year.
In July, I build a budget 2 (B2) for  monthly sales from July until the end of year.

Kind of reforecast.

 

What I'm trying to achieve is displaying either B1 or B2 data depending on the selected date.

e.g display B1 on my chart when selecting April or B2 when selecting September sales.

 

I built the following formula, which may not be optimized, but still works 🙂

SWITCH BU1 / BU2 =
VAR PeriodSelection =
    SELECTEDVALUE ( 'Dates'[Month] )
RETURN
    SWITCH (
        True();
        PeriodSelection = "Jan"; [BU1 Sales];
        PeriodSelection = "Feb"; [BU1 Sales];
        PeriodSelection = "Mar"; [BU1 Sales];
        PeriodSelection = "Apr"; [BU1 Sales];
        PeriodSelection = "May"; [BU1 Sales];
        PeriodSelection = "Jun"; [BU1 Sales];
        PeriodSelection = "Jul"; [BU2 Sales];
        PeriodSelection = "Aug"; [BU2 Sales];
        PeriodSelection = "Sep"; [BU2 Sales];
        PeriodSelection = "Oct"; [BU2 Sales];
        PeriodSelection = "Nov"; [BU2 Sales];
        PeriodSelection = "Dec"; [BU2 Sales];
        BLANK()
 
The problem that, whenever I chose a month, my visual is obvsiouly filtered on that single mont instead of showing the data for the year...
        )Filtre year.PNG

Do you have any idea to solve this ?
 
Thanks for your help
 
Benjamin
 
4 REPLIES 4
v-yuta-msft
Community Support
Community Support

@Anonymous,

 

So your requirement is that you don't want other chart be filtered by slicer chart, right? You can click Format-> Edit Interactions and then click right-top hand of other visuals, click disable icon.

Capture.PNG2.PNG 

 

Community Support Team _ Jimmy 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 @v-yuta-msft ,

 

Thanks for replying.

Not exactly, I don't want my table to be affected by that month slicer but I want my SWITCH function (used in the table) to be affected.

Since the SWITCH depends on the month selected.

 

That's why I was thinking about an intermediate table or something ...?

 

Because I need the table to display all the months (therefore not being filtered) and the SWITCH to be affected by the month slicer (because it displays different data depending on the month selected.

 

Best regards,

 

Benjamin

@Anonymous ,

 

"

That's why I was thinking about an intermediate table or something ...?

 

Because I need the table to display all the months (therefore not being filtered) and the SWITCH to be affected by the month slicer (because it displays different data depending on the month selected.

"

 

Have you tried the way above? To disable visual be filtered by slicer, you should click "Edit Interaction" and then click "Disable icon" in the visual.

 

Community Support Team _ Jimmy 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,

 

Thanks for answering.

If a disable the relationship between my visual, the SWITCH function is not working anymore.

 

I figured out that what I was trying to achieve was not possible (both remove relationship with filter while having my DAX formulas affected by the filter).

 

Then I gave up.

 

Regards

Benjamin

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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