cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jjuelke
Advisor

Measure with Username() shows cryptic value when used with "analyse in excel"

Situation:
Created a simple PBIX testfile with two measures:
- myUsername = USERNAME()
- CurrentDT = NOW()

 

This measures display fine in PBI Desktop and, after publishing, in PowerBI.COM

Unfortunately, when i use the feature "analyse" in Excel and put the measure into values area of pivot-table, the measure myUsername gets numeric scrambled and looks like this:

ExcelVsPBI.jpg

Can anyone confirm this as a bug?

or do i need a special formula to use username() to work/display correctly in excel or any other OLAP Client?

As by Information Design requirements we have to dump the "who" information in every reports header, so it would be really helpful ithis is possible.

 

Best Regards,

Jochen

4 REPLIES 4
Community Support Team
Community Support Team

Re: Measure with Username() shows cryptic value when used with "analyse in excel"

Hi @jjuelke,

 

>>Can anyone confirm this as a bug?

 

Based on test, I find the username function has the different result from desktop and service side, you can use USERPRINCIPALNAME function to work through this issue.

 

For detail infromation, you can refer to bleow article:

 

On the desktop, the USERNAME() function returns the user’s domain login (domain\login). However, when the model is deployed to powerbi.com, Username() returns the user principal name, which typically (but not always depending on how your AD is set up) is the user’s email address. To simplify dynamic security based on the user identity, DAX introduces a new USERPRINCIPALNAME() function that can help you secure on a column that has the user principal name. This avoids having to use an OR filter to support both deployment scenarios.

 

Notice that if your computer is not joined to a domain, both USERNAME() and USERPRINCIPALNAME() return the same thing (domain\login).

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
jjuelke
Advisor

Re: Measure with Username() shows cryptic value when used with "analyse in excel"

Hi @v-shex-msft,

thanks for the hint with USERPRINCIPALNAME but this was not the questions! Smiley Wink

 

The questions is:  Why do DAX-Measure like USERNAME() not display correctly when you connect to the PowerBI Dataset with a MSOLAP.7 Connectionstring (aka. "Analyse in Excel"). Is this a bug in the MSOLAP.7 Provider oder in PowerBI.com ?

 

 

 

 

jjuelke
Advisor

Re: Measure with Username() shows cryptic value when used with "analyse in excel"

OlapProviderMeasures.jpg

Community Support Team
Community Support Team

Re: Measure with Username() shows cryptic value when used with "analyse in excel"

Hi @jjuelke,

 

Below is my test result, the functions work well on my side.

 

Capture.PNGCapture2.PNG

 

I test on office 2016 and power bi desktop 2.41.4581.361 64-bit (November 2016).
Capture3.PNG

 

Which version of excel you used?

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |