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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
SammiElPadre
Frequent Visitor

Date Dimension change based on slicer selection

Hi Folks,

I think i can't be the first one to encounter this problem.

 

I've got a report, usually based on months, so my x-axis of most visuals is something like 01-22 02-22 etc.

So now if my user selects a single month out of my column Monthname via slicer, all visuals will show a single bar, point and so on.

 

So, I want to change the x-axis day-based.

For this, I worte two measures:

First, I get the destinct count of my Months for the slicer. If theres only one monthname, count will be one, if there is more than one monthname, it will be another number.

 

Anzahl Monate = Distinctcount(KALENDER[Monatsname])
After that, I wrote another measure, which is a switch-statement based on what number my first measure gives back:

Datumsswitch =
       var selectedmonth = [Anzahl Monate]

    return
        SWITCH(selectedmonth, 1, SELECTEDVALUE(Kalender[Datum]),"Fehler Datum",
           12,Selectedvalue(KALENDER[Eindeutiger Monat], "Fehler Monat"),
            "Mehrfachauswahl")
So, basically, what I'm trying to do is: If the count of monthnames is one, select the Date-Coloumn, if its 12, select the Month-Coloumn, if its anything else give back "Multiple selections"
 
It works pretty fine with the defaults, but it's not giving back any of my dates.
 
I know I made a mistake somwhere on the way, but I don't get the clue where I made it. Could you please give me a hind?
 
Kind regards
Sammi
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@SammiElPadre , If you need a dynamic axis based on selected values, I doubt that is possible as of now.

 

You can give a slicer using field parameters: Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@SammiElPadre , If you need a dynamic axis based on selected values, I doubt that is possible as of now.

 

You can give a slicer using field parameters: Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Ok, thank you. 

 

BAd news, but then it has to be manual.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.