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.
Hello,
I'm using the table F_SURVEY with the fields: PK_SURVEY, GROUP, M1, M2, M3 and YEAR
To select the most recent data I added a calculated column:
Is Most Recent Data = IF(F_SURVEY[YEAR] = MAX(F_SURVEY[YEAR]); 1; 0)
I represent the data in a Stacked Column Chart
A filter is set to represent only the most recent data
The tooltips on this visual are different according of the 3 stacked values M1, M2, M3
I want the tooltips different:
YEAR 2020 GROUP group 5 M1 14% |
YEAR 2020 GROUP group 5 M2 78% |
YEAR 2020 GROUP group 5 M3 8% |
How can I do this?
The main question is how can I, in a customized tooltip, let the last line switch between M1, M2 and M3 according the block I hover over?
Thanks
R.W.
Solved! Go to Solution.
Hi @Anonymous
The result you want is to show 14%(should in M3) in M1,8%(should in M1) in M3, 78%(should in M2) in M2.
You can try to unpivot your table and then build a measure.
Select M1,M2,M3 in power query and use unpivot option.
Measure:
Measure =
VAR _M1 = CALCULATE(SUM(F_SURVEY[PERCENTAGE]),FILTER(ALL(F_SURVEY),F_SURVEY[GROUP]=MAX(F_SURVEY[GROUP])&&F_SURVEY[M TYPE]="M1"&&F_SURVEY[YEAR]=MAX(F_SURVEY[YEAR])))
VAR _M2 = CALCULATE(SUM(F_SURVEY[PERCENTAGE]),FILTER(ALL(F_SURVEY),F_SURVEY[GROUP]=MAX(F_SURVEY[GROUP])&&F_SURVEY[M TYPE]="M2"&&F_SURVEY[YEAR]=MAX(F_SURVEY[YEAR])))
VAR _M3 = CALCULATE(SUM(F_SURVEY[PERCENTAGE]),FILTER(ALL(F_SURVEY),F_SURVEY[GROUP]=MAX(F_SURVEY[GROUP])&&F_SURVEY[M TYPE]="M3"&&F_SURVEY[YEAR]=MAX(F_SURVEY[YEAR])))
RETURN
SWITCH(MAX(F_SURVEY[M TYPE]),"M1",_M3,"M3",_M1,_M2)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , You can add a year to the tooltip
or you can create a tooltip page : https://docs.microsoft.com/en-us/power-bi/desktop-tooltips
Thanks @amitchandak
I knew how to make a tooltip but I don't see a solution for how I can, in a customized tooltip, let the line that refers to the values switch between the value fieldnames according the block I hover over. Just as the standard tooltip does.
R.W.
Hi @Anonymous
The result you want is to show 14%(should in M3) in M1,8%(should in M1) in M3, 78%(should in M2) in M2.
You can try to unpivot your table and then build a measure.
Select M1,M2,M3 in power query and use unpivot option.
Measure:
Measure =
VAR _M1 = CALCULATE(SUM(F_SURVEY[PERCENTAGE]),FILTER(ALL(F_SURVEY),F_SURVEY[GROUP]=MAX(F_SURVEY[GROUP])&&F_SURVEY[M TYPE]="M1"&&F_SURVEY[YEAR]=MAX(F_SURVEY[YEAR])))
VAR _M2 = CALCULATE(SUM(F_SURVEY[PERCENTAGE]),FILTER(ALL(F_SURVEY),F_SURVEY[GROUP]=MAX(F_SURVEY[GROUP])&&F_SURVEY[M TYPE]="M2"&&F_SURVEY[YEAR]=MAX(F_SURVEY[YEAR])))
VAR _M3 = CALCULATE(SUM(F_SURVEY[PERCENTAGE]),FILTER(ALL(F_SURVEY),F_SURVEY[GROUP]=MAX(F_SURVEY[GROUP])&&F_SURVEY[M TYPE]="M3"&&F_SURVEY[YEAR]=MAX(F_SURVEY[YEAR])))
RETURN
SWITCH(MAX(F_SURVEY[M TYPE]),"M1",_M3,"M3",_M1,_M2)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
76 | |
62 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |