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! Request now

Reply
PeterNg
New Member

Unable to use Parameter Dynamic Filter

I created the Select Calendar Grouping parameter so users can choose their preferred view.

For the Quarter View, it goes back 8 quarters; for the Month View, it goes back 12 months; and for the Week View, it goes back 13 weeks.

I was able to implement this for the one of the report, but I’m having trouble doing the same with the reports on the same page.

The current setup for the report that working
Rows1 : Blank
Columns1: Select Calendar Grouping


The current setup for the report that not working 
Rows2 : Monitor Grouping
Columns2: Select Calendar Grouping

If I switched between Rows and Columns field then the logic of Calendar Grouping will works as expected.

Below is the DAX to dynamic filtering the Calendar Grouping
Reader Head Shipment =

VAR tmp =
    SELECTCOLUMNS('Calendar Grouping',"PT", [Select Calendar Grouping])
VAR _str =
    CONCATENATEX(tmp,[PT])
VAR _a =
    SWITCH(
        TRUE(),
        COUNTROWS(tmp) =3,1,
        CONTAINSSTRING( _str, "Quarter"),IF(SELECTEDVALUE(FISCAL_CALENDAR[FISCAL_QTR_REL]) >= -7,1),
        CONTAINSSTRING( _str, "Month"),IF(SELECTEDVALUE(FISCAL_CALENDAR[FISCAL_MONTH_REL]) >= -11,1),
        CONTAINSSTRING( _str, "Week"),IF(SELECTEDVALUE(FISCAL_CALENDAR[FISCAL_WEEK_REL]) >= -12,1)
    )
    RETURN _a

 

 

2 REPLIES 2
PeterNg
New Member

How do you apply CALCULATE with ALLSELECTED in the DAX above? 

 

grazitti_sapna
Super User
Super User

Hi @PeterNg  ,

I can see you're having trouble implementing the calendar grouping logic across multiple reports on the same page in Power BI. Let me help troubleshoot your DAX formula for filtering based on the selected calendar grouping.

Looking at your code, I notice a few potential issues:

In your SWITCH statement, you're using asterisks (*) instead of underscores (_) in some variable references like "*str" instead of "_str"
The condition checking for all three options being selected (COUNTROWS(tmp) =3) doesn't specify what should happen in that case
Here's a corrected version of your DAX measure:

Reader Head Shipment =
VAR tmp =
SELECTCOLUMNS('Calendar Grouping', "PT", [Select Calendar Grouping])
VAR _str =
CONCATENATEX(tmp, [PT])
VAR _a =
SWITCH(
TRUE(),
COUNTROWS(tmp) = 3, 1,
CONTAINSSTRING(_str, "Quarter"), IF(SELECTEDVALUE(FISCAL_CALENDAR[FISCAL_QTR_REL]) >= -7, 1, 0),
CONTAINSSTRING(_str, "Month"), IF(SELECTEDVALUE(FISCAL_CALENDAR[FISCAL_MONTH_REL]) >= -11, 1, 0),
CONTAINSSTRING(_str, "Week"), IF(SELECTEDVALUE(FISCAL_CALENDAR[FISCAL_WEEK_REL]) >= -12, 1, 0),
0
)
RETURN _a
 

For the report where it's not working (with Rows2: Monitor Grouping and Columns2: Select Calendar Grouping), the issue might be related to filter context. When you have different fields in the rows, the filter context changes, which can affect how your measure evaluates.

Try these approaches:

Make sure your Calendar Grouping parameter is properly connected to both visuals
Consider using CALCULATE with ALLSELECTED to maintain proper filter context
Check if the field references in your second report match exactly with your first report
Would you be able to share what type of visuals you're using for both reports? That might help me give you more specific advice on fixing the issue.


🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors