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
matrix_user
Helper III
Helper III

Slicer DAX

1) I am trying to get all my options in the slicer to show values. Currently, I can only see values in the cluster column visual for “Y”:

matrix_user_0-1649128864660.png

2) If I click to “W” or “Q” or “M” no values show up in the chart:

matrix_user_1-1649128864663.png

3) I have looked at the DAX for the measure “QTY Total” that is used for the chart:

 

matrix_user_2-1649128864667.png

4) In my journey to find a solution, I changed the last portion of the DAX by replacing ‘Calendar’[Year] with [Month]:

 

matrix_user_3-1649128864668.png

 

5) With the change, the values for “Y” and "M" appears in the clustered columns visual - but nothing for “Q” or “W" 

matrix_user_4-1649128864672.png

 6) How can I modify the DAX to include "Y", "M", "Q" and "W"?

 

Any help would be appreciated:

 

https://www.dropbox.com/s/f3hh4vzkkiz0agv/ScooterWorld.pbix?dl=0

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @matrix_user 
This is one of the simplest and greatest ideas I've ever seen and I really thank you for for posting this. 
A small fix and all good to go https://www.dropbox.com/t/vxCj7mCtgVRteRcN

QTY Total : = 
SWITCH (
    SELECTEDVALUE ( Slicer[Index Desc], 1 ),
    1,
        CALCULATE (
            SUM ( ScooterSales[Sold Cash] ),
            TREATAS ( VALUES ( Slicer[Period] ), 'Calendar'[Year] )
        ),
    153,
        CALCULATE (
            SUM ( ScooterSales[Sold Cash] ),
            TREATAS ( VALUES ( Slicer[Period] ), 'Calendar'[YearQuarter] )
        ),
    165,
        CALCULATE (
            SUM ( ScooterSales[Sold Cash] ),
            TREATAS ( VALUES ( Slicer[Period] ), 'Calendar'[Month] )
        ),
    5,
        CALCULATE (
            SUM ( ScooterSales[Sold Cash] ),
            TREATAS ( VALUES ( Slicer[Period] ), 'Calendar'[Year&WeekNumber(a)] )
        ),
    CALCULATE (
        SUM ( ScooterSales[Sold Cash] ),
        TREATAS ( VALUES ( Slicer[Period] ), 'Calendar'[Year] )
    )
)

 1.png2.png3.png5.png

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @matrix_user 
This is one of the simplest and greatest ideas I've ever seen and I really thank you for for posting this. 
A small fix and all good to go https://www.dropbox.com/t/vxCj7mCtgVRteRcN

QTY Total : = 
SWITCH (
    SELECTEDVALUE ( Slicer[Index Desc], 1 ),
    1,
        CALCULATE (
            SUM ( ScooterSales[Sold Cash] ),
            TREATAS ( VALUES ( Slicer[Period] ), 'Calendar'[Year] )
        ),
    153,
        CALCULATE (
            SUM ( ScooterSales[Sold Cash] ),
            TREATAS ( VALUES ( Slicer[Period] ), 'Calendar'[YearQuarter] )
        ),
    165,
        CALCULATE (
            SUM ( ScooterSales[Sold Cash] ),
            TREATAS ( VALUES ( Slicer[Period] ), 'Calendar'[Month] )
        ),
    5,
        CALCULATE (
            SUM ( ScooterSales[Sold Cash] ),
            TREATAS ( VALUES ( Slicer[Period] ), 'Calendar'[Year&WeekNumber(a)] )
        ),
    CALCULATE (
        SUM ( ScooterSales[Sold Cash] ),
        TREATAS ( VALUES ( Slicer[Period] ), 'Calendar'[Year] )
    )
)

 1.png2.png3.png5.png

tamerj1... a big thank you to you!

amitchandak
Super User
Super User

@matrix_user , I think you trying axis slicer using one of the approaches used in this video

Three approch from Guyinacube https://www.youtube.com/watch?v=dYmzb5UMkXw

 

I think you need to use userelationship with few changes

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

Hi Amitcanddax,

 

Nice to know other ways of building dynamic slicers but at this stage DAX is the way to go The DAX shown in the video is leaving me worse that the one I am trying to fix. Cheers

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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