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
Anonymous
Not applicable

Show current week if not filter selected

Hi, I have a table with weekly data,

yellow_old_5_0-1686834907580.png

when the week slicer is not filtred then show current week but otherwhise show value from week slicer.

yellow_old_5_1-1686835074465.png

Thanks for helping.

 

1 ACCEPTED SOLUTION

Hi, @Anonymous 

 

You can try the following methods.

Measure = 
SWITCH ( TRUE (),
    COUNTROWS ( ALLSELECTED ( 'Table'[Week Number] ) ) = COUNTROWS ( ALL ( 'Table'[Week Number] ) )
        && WEEKNUM ( TODAY (), 1 ) = SELECTEDVALUE ( 'Table'[Week Number] ), 1,
    ( COUNTROWS ( ALLSELECTED ( 'Table'[Week Number] ) ) = COUNTROWS ( ALL ( 'Table'[Week Number] ) )
    ) = FALSE (), 1
)

vzhangti_0-1687768105568.png

No filtering:

vzhangti_1-1687768146846.png

After filter:

vzhangti_2-1687768226396.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Like this when nothing is filtred:

yellow_old_5_0-1686905314783.png

and like this when is filtred:

yellow_old_5_1-1686905407560.png

Thanks for all help.

 

Hi, @Anonymous 

 

You can try the following methods.

Measure = 
SWITCH ( TRUE (),
    COUNTROWS ( ALLSELECTED ( 'Table'[Week Number] ) ) = COUNTROWS ( ALL ( 'Table'[Week Number] ) )
        && WEEKNUM ( TODAY (), 1 ) = SELECTEDVALUE ( 'Table'[Week Number] ), 1,
    ( COUNTROWS ( ALLSELECTED ( 'Table'[Week Number] ) ) = COUNTROWS ( ALL ( 'Table'[Week Number] ) )
    ) = FALSE (), 1
)

vzhangti_0-1687768105568.png

No filtering:

vzhangti_1-1687768146846.png

After filter:

vzhangti_2-1687768226396.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous ,  Try a measure like, Assuming you are using date table

 

if(isfiltered(Date[Week]), Sum(Table[Values]), calculate(Sum(Table[Values]), filter(Date, Date[Week] = )year(today())*100 + weeknum(today()) ) )

 

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
Anonymous
Not applicable

Hi Thanks you for your reply but its not working, Its still show all values when is not filtered, my goal is when is not filtred the table only show current week and if filtred show selected weeks of data.

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