Forum Discussion
Dynamic Chart Title based on User Login
Hi All,
DAX Expert I have very interesting Need for one of my report, I need Dynamic Chart Title based on the User login.
I have the table with Email, Visual Name, LatestRatingDate and Rating as seen in the screen print.
Now I Need Dynamic Chart Title based on the user login, the Title should be a combination of Visual Name along with Rating for LatestRatingDate date along with the No of Stars, for example if
1. User1 is login the Chart Tile should be “Chart3 (4) - ★ ★ ★ ★” similarly.
2. User4 login the Chart Tile should be “Chart4 (3.5) - ★ ★ ★”.
3. User6 login the Chart Tile should be “Chart2” Etc….
Table:
User1:
User4:
User6:
Please assit me with the DAX Measure so the Title change Dynamic when user log in. Thanks🙏
Regards
Suhel
- Anonymous4 years ago
You can refer to this
Star = VAR rating = MAXX(FILTER('table', 'table'[Email]=USERPRINCIPALNAME()), [Rating]) RETURN REPT(UNICHAR(9733), INT(rating )) & REPT(UNICHAR(9734), INT((rating - INT(rating ))/0.5))
5 Replies
- v-yalanwu-msftCommunity Support
Hi, Suhel_Ansari
You could Using the username() or userprincipalname() DAX function.
Then Save, and publish your solution to Power BI. In Power BI service go to security setting of the data set you just published.
As you can see every user only see the transaction that he handled and his record.
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- Suhel_AnsariHelper V
v-yalanwu-msft , I know that however i need a measure to get the latest reating input from user to add dynamic Title in chart. Thanks
- v-yalanwu-msftCommunity Support
Hi, Suhel_Ansari ;
You could create a measure
Measure = var _a=CALCULATE(MAX('Table'[Visual Name]) ,FILTER('Table',[LatestRatingDate ]= CALCULATE(LASTDATE('Table'[LatestRatingDate ]),FILTER(ALLSELECTED('Table'),[Email ]=MAX([Email ]))))) var _b=CALCULATE(MAX('Table'[Rating]) ,FILTER('Table',[LatestRatingDate ]= CALCULATE(LASTDATE('Table'[LatestRatingDate ]),FILTER(ALLSELECTED('Table'),[Email ]=MAX([Email ]))))) return IF(MAX('Table'[Rating])=BLANK(), _a,_a & "("&_b&")") &"-"&SWITCH(ROUNDDOWN(_b,0),1,"★",2,"★★",3,"★★★",4,"★★★★",5,"★★★★★")Then apply it into title fx.
The final output is shown below:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - Suhel_AnsariHelper V
Hi amitchandak , please assit.. Thanks
- AnonymousNot applicable
You can refer to this
Star = VAR rating = MAXX(FILTER('table', 'table'[Email]=USERPRINCIPALNAME()), [Rating]) RETURN REPT(UNICHAR(9733), INT(rating )) & REPT(UNICHAR(9734), INT((rating - INT(rating ))/0.5))