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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
desasaurus
Frequent Visitor

Filter works in Desktop but not in Web Service

I have a measure filtering a matrix, it works exactly as expected in the desktop but fails after publish. I can't interact with it in any way after publishing.

Desktop:

desasaurus_0-1621881439154.png

Web Service:

desasaurus_2-1621881797627.png

 

 

The Measure Im using to filter:

Epsilon =

var CPM =
IF(
CONTAINS('Project Leadsership', 'Project Leadsership'[email_addr], USERPRINCIPALNAME())
&& CONTAINS('Project Leadsership', 'Project Leadsership'[resp_type_code], "R10")
&& CONTAINS('Project Leadsership', 'Project Leadsership'[prj_status_ind], "A"),
1,
0)

var BUD =
IF(
CONTAINS('Organizational Leadership', 'Organizational Leadership'[Email Address], USERPRINCIPALNAME())
&& CONTAINS('Organizational Leadership', 'Organizational Leadership'[resp_type_code], "RM")
&& CONTAINS('Organizational Leadership', 'Organizational Leadership'[Organization Status Indicator], "A"),
1,
0)

var AM =
IF(
CONTAINS('Organizational Leadership', 'Organizational Leadership'[Email Address], USERPRINCIPALNAME())
&& CONTAINS('Organizational Leadership', 'Organizational Leadership'[resp_type_code], "AM")
&& CONTAINS('Organizational Leadership', 'Organizational Leadership'[Organization Status Indicator], "A"),
1,
0)

RETURN

IF(BUD+AM+CPM > 0, 1, 0)
 
Been stuck on this for a while any help is appreciated.
1 ACCEPTED SOLUTION

@desasaurus ,

Since you have tried almost everything, I guess the best option right now would be to raise a ticket with MS Support(Link) to understand the issue.

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

View solution in original post

9 REPLIES 9
Anand24
Super User
Super User

Hi @desasaurus ,

 

The dependable function in your DAX is USERPRINCIPALNAME(). There are a lot of times that this function returns different values in Desktop and Services.

For Example:

USERPRINCIPALNAME() = FirstName.LastName@org.com in Desktop and USERPRINCIPALNAME()=SSO@org.com in services.

 

To check too, you can do one thing. Check what is the USERPRINCIPALNAME() value in desktop and put it as static value in your DAX. Try this in Desktop and Services.

 

Secondly, do try everything in incognito mode just to avoud any Cache dependency.

 

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

I've already done this test, all our data lines up in both the desktop and web service. as per the picture above, the issue is that the filter simply isnt apllying on the webservice. my dax works fine and has no issues whatsoever in the desktop, and the USERPRINCIPALNAME function works perfectly as expected on both platforms as well.

@desasaurus ,

Since you have tried almost everything, I guess the best option right now would be to raise a ticket with MS Support(Link) to understand the issue.

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

v-xulin-mstf
Community Support
Community Support

Hi @desasaurus,

 

I created the measure with sample data but it works well in my environment.

v-xulin-mstf_0-1622083878852.png

You can republish the report and check.

Maybe the issue is not caused by the measure, please try to add other filters to test.

Looking forward to your reply.

 

Best Regards,
Link

 

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

I've isolated this visual and filter away from the rest of the report in a new .pbix file and still no dice. I also removed the date and employee selection slicers and still no dice after publish. 

 

Thanks,

desasaurus

Hi @desasaurus

 

Please check if the UPN on the power bi service is the same as your local UPN.

v-xulin-mstf_0-1622182540590.png

After publishing to service:

v-xulin-mstf_1-1622182599999.png

Please check if the red marked parts are consistent.


If it does not, USERPRINCIPALNAME() will return different values on power bi desktop and power bi service.
Maybe this is causing your problem.

 

Best Regards,
Link

 

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

My dax is working fine, USERPRINCIPALNAME has the same results in both platforms, and the only issue seems to be the filter not applying in the webservice.

Fowmy
Super User
Super User

@desasaurus 

Hope you check with the same user name both in the desktop and the service?
Create a measure like below and check to see

user = USERPRINCIPALNAME()




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

I've done this test before with a card to display results with multiple members of my organization. the measure seems to be working fine as it works exacltly as excpected in desktop.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors