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

Filter by WeekNumber & SelectedValue not working

Hi, I've searched a lot of other posts but I can't seem to solve my problem.

 

I have 2 main tables - Mobile & Web that record users of our apps. 
There is a 3rd table called AuthActivations that records the date when each user was "activated" in our system.

I also have a DateDim (calendar) table, with a WeekNumber field so the above 3 tables can be grouped by weekly usage. 
The AuthActivations need to have a cumulative value with the number of new users added on each week.

I've created a seperate table - WeeklyActivations - that lists all the weeks from my calendar table & the weekly count & cumulative sum of values from AuthActivations. 
I've added 2 more columns to this table to get the weekly distinct users from the mobile & web tables.

These last 2 columns work fine when I get the users when grouped by week.
But I also want to be able to see users from a specific company - so need to be able to filter the "Mobile" & "Web" by the selected filter (a single selection of BusinessId) & just get a distinctCount each week.
BUT when I try to add in the filter for the selectedBusinessId, it returns me a whole column of 0s. 
If I substitute a hard-coded value in for the SelectedValue (which is in a measure & used as a variable, "__selectedBusinessId"), it works fine. 
Which leads me to believe there's something going on when I'm using a SelectedValue as a filter!

MobileCount_Weekly =
var __selectedBusinessId = IF('All Measures'[Selected BusinessId] > 0, 'All Measures'[Selected BusinessId])
var __joinColumn = 'Weekly Activations'[WeekNumber]
var __mobileCount_Weekly = CALCULATE(
DISTINCTCOUNT(Users_Mobile[MobileUserId]),
FILTER(Users_Mobile,
'Users_Mobile'[WeekNumber] = __joinColumn
&& 'Auth0Users_Mobile'[Business_Id] = __selectedBusinessId
)
)
return IF(ISBLANK(__mobileCount_Weekly), 0, __mobileCount_Weekly)
 
This is the line that is broken & will work if I hard-code a value 
&& 'Auth0Users_Mobile'[Business_Id] = __selectedBusinessId
I've double checked that this works by using the output of the measure in a card:
var __selectedBusinessId = IF('All Measures'[Selected BusinessId] > 0, 'All Measures'[Selected BusinessId])

Please help!
4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description, this situation might be caused by lacking of relationship between two tables, And when using selectedvalue, it will force tables create a relationship.

These are just my guesses, otherwise, could you please share some example data or PBIX to me if you don't have any Confidential Information?

If so, please upload your files to One Drive and share the link here.

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

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

Anonymous
Not applicable

Hi @Anonymous ,

 

thanks for your response.

Below is a link to OneDrive with the .pibx files. Please let me know if its not accessible.

 

Regarding the relationships: I have joined the necessary tables to be able to filter by BusinessId - 

Auth0Users_Mobile & 
Auth0Users_Web.
 
the problematic columns are in the 'Weekly Activations' table: 
Anonymous
Not applicable

Hi @Anonymous ,

 

The pbix is not accessible, please make sure anyone with the link can edit it.

1.PNG

 

Best Regards,

Jay

Anonymous
Not applicable

Hi Jay, I've sent you a Private message regarding this. 
Basically I can't make anything on our company's OneDrive public, but I can open it up to you via an email invitation.

Could you send me your email please?

 

thanks 

Anne

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