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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
rnambiar
Frequent Visitor

Combine a Parametric slicer with another slicer - one for Metric selection and the other for Period

I have 2 slicers as shown below: 

1.  Metric 

2.  Period

rnambiar_0-1726678079123.png

I have a combination Line/Bar chart as follows.  The Metice slicer is Parametric slicer and works fine.  I'd like to be able to combine the Period Slicer with the Metric Slicer such that when Revenue is selected and Period is selected the relevant values for Revenue are displayed i.e.

1.  Revenue + Month = display revenue for the month, 

2.  Revenue + YTD = display YTD revenue for the month (in the bar for the month) and so on.

rnambiar_1-1726678143482.png

 

Below is the code for the Slicer (Parametric).  This works fine and I am able to switch between the various Metrics without a problem.

 

 

 

Metric = {
    ("Revenue", NAMEOF('FSMeasures'[Revenue]), 0),
    ("Gross Profit", NAMEOF('FSMeasures'[Gross Profit]), 1),
    ("Net Profit", NAMEOF('FSMeasures'[Net Profit]), 2)
}

 

 

 

 

For the Time Intelligence slicer, I created a table as follows:

Period  Order

Month0
YTD1
TTM2

 

The dax code I used to switch between the Periods here is:

 

 

 

Period = 
VAR P1 = SELECTEDVALUE('Table'[Order])
VAR M1 = SELECTEDVALUE(Metric[Parameter Fields]) 

VAR Result = 
            SWITCH(P1,
                0, M1,
                1, TOTALYTD(M1,DATESYTD('Calendar'[Date]),"12/31"),
                2, CALCULATE(M1,
		DATESINPERIOD('Calendar'[Date],MAX('Calendar'[Date]),-12,MONTH)
		),
                99999
            )

RETURN
    Result

 

 

 

The result I am getting is:

rnambiar_2-1726680534888.png

Any help is greatly appreciated.

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@rnambiar this is not possible:

 

VAR M1 = SELECTEDVALUE(Metric[Parameter Fields]) 

 

For Time intelligence create a calculation group and in the calculation group use selectedmeasure() and that I think will do it.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

Sooo much effort.  Instead, enable "Personalize Visuals"  and teach your users how to use it.

parry2k
Super User
Super User

@rnambiar this is not possible:

 

VAR M1 = SELECTEDVALUE(Metric[Parameter Fields]) 

 

For Time intelligence create a calculation group and in the calculation group use selectedmeasure() and that I think will do it.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

YEs the calculation group worked

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors