Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I would love some help from you all re making legend categories for a visual from a calculated measure.
Below is representative data that I have in a single table:
Encounter | Code | RVU | Month |
1 | 49083 | 2 | Jan |
2 | 36014 | 3.02 | Jan |
2 | 36015 | 3.51 | Jan |
2 | 37211 | 0 | Jan |
2 | 76937 | 0.3 | Jan |
3 | 49452 | 2.86 | Feb |
4 | 10160 | 1.25 | Feb |
4 | 77012 | 1.5 | Feb |
5 | 47534 | 7.6 | March |
6 | 93922 | 0.25 | March |
7 | 36589 | 2.28 | March |
7 | 36901 | 3.36 | March |
8 | 49083 | 2 | March |
9 | 10005 | 1.46 | March |
10 | 38222 | 1.44 | March |
10 | 77012 | 1.5 | March |
As you can see, multiple Billing Codes and associated RVU Values for each Encounter. I am trying to make a stacked column chart visual:
Y- axis = Count of Encounter (Distinct)
X- axis = grouped by Month
Legend = "Sum RVU for Encounter > 5" OR "Sum RVU for Encounter < 5"
(i.e. Encounter 1 = 2.0 RVU; Encounter 2 = 6.83 RVU; etc)
I have correctly classified individual Encounters as ">5" (High) or "<5" (Low) in a table visual as below using the following measure...
Solved! Go to Solution.
hello @willit6182
I believe you can only add column as visual legend.
So if you have to add legend, you need to make another calculated column which defines Total RVU Classification.
Here is one of many ways to do this.
1. create new table and summarize your original table. In summarize table, calculate sum of RVU as well.
2. create a calculated column to define Total RVU Classification.
3. make relationship between original table and summarized table.
4. plot your data in stacked column chart. Take Total RVU Classification column as visual legend.
Also dont forget to change Y-Axis value into count distinct since you want to show encounter value as distinct value.
Now, let us check using your original table. i.e in March, the red color indicates sum of RVU that will get High in Total RVU Classification. While the green color indicates sum of RVU that will get Low in Total RVU Classification.
and in stacked visual in March, value of High is 2 (distinct count encounter red color) and value of Low is 4 (distinct count encounter green color).
Hope this will help you.
Thank you.
Hi @willit6182 ,
Thanks for the reply from @Irwan , please allow me to provide another insight:
In Power BI, a Measure is usually not used directly as a legend field. Legend fields usually require a Dimension, which is categorical data, whereas Measures are numeric data that are used for calculations and aggregation.
You can put it into the legend by creating calculated columns.
Total RVU Classification =
VAR TotalRVU =
CALCULATE (
SUM ( 'Table'[RVU] ),
FILTER ( 'Table', 'Table'[Encounter] = EARLIER ( 'Table'[Encounter] ) )
)
RETURN
IF ( TotalRVU > 5, "High", "Low" )
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @willit6182 ,
Thanks for the reply from @Irwan , please allow me to provide another insight:
In Power BI, a Measure is usually not used directly as a legend field. Legend fields usually require a Dimension, which is categorical data, whereas Measures are numeric data that are used for calculations and aggregation.
You can put it into the legend by creating calculated columns.
Total RVU Classification =
VAR TotalRVU =
CALCULATE (
SUM ( 'Table'[RVU] ),
FILTER ( 'Table', 'Table'[Encounter] = EARLIER ( 'Table'[Encounter] ) )
)
RETURN
IF ( TotalRVU > 5, "High", "Low" )
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hello @willit6182
I believe you can only add column as visual legend.
So if you have to add legend, you need to make another calculated column which defines Total RVU Classification.
Here is one of many ways to do this.
1. create new table and summarize your original table. In summarize table, calculate sum of RVU as well.
2. create a calculated column to define Total RVU Classification.
3. make relationship between original table and summarized table.
4. plot your data in stacked column chart. Take Total RVU Classification column as visual legend.
Also dont forget to change Y-Axis value into count distinct since you want to show encounter value as distinct value.
Now, let us check using your original table. i.e in March, the red color indicates sum of RVU that will get High in Total RVU Classification. While the green color indicates sum of RVU that will get Low in Total RVU Classification.
and in stacked visual in March, value of High is 2 (distinct count encounter red color) and value of Low is 4 (distinct count encounter green color).
Hope this will help you.
Thank you.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
90 | |
84 | |
70 | |
49 |
User | Count |
---|---|
141 | |
121 | |
112 | |
59 | |
58 |