Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
I created a simple Measure that returns the results I expect in a Table. However, I need to be able to use the Measure in a Legend so I am trying to convert it to a Calculated Column instead.
These are the measures I created:
Note_Cnt = Sum(Note_Usage[NoteCount])
Patient = IF([Note_Cnt]>=200,"Seeing Patients","Not Seeing Patients")
This is a table showing the correct results:
Data looks like this: (Note: There are many rows of data for a Customer.)
Cust Name NoteCount
ABC John 5
ABC Jim 2
ABC Alice 55
XYZ Dave 16
XYZ Todd 45
I can't seem to get the formula correct for the calculated column. Please help. Thanks.
Solved! Go to Solution.
Hey @Alicia_Anderson ,
the following calculated column should give you the correct total value for each Cust:
Note_Cnt Column =
CALCULATE(
SUM( Note_Usage[NoteCount] ),
ALLEXCEPT(
Note_Usage,
Note_Usage[Cust]
)
)
For the next step just make sure that you take the MAX and not the SUM per Customer.
Or you skip the step and get everything in one calculated column:
Patient Column =
VAR vNoteCount =
CALCULATE(
SUM( Note_Usage[NoteCount] ),
ALLEXCEPT(
Note_Usage,
Note_Usage[Cust]
)
)
RETURN
IF(
vNoteCount >= 200,
"Seeing Patients",
"Not Seeing Patients"
)
Outstanding. The latter gave me what I needed in one column but I kind of like the idea of having one colmun to calculate the customer total and one column to set the Patient field based on that (which I was able to now do). Any negative to using two columns or it is better to combine into one?
Hey @Alicia_Anderson ,
you can do it in one or two column, there is not much difference.
Best regards
Denis
Hey @Alicia_Anderson ,
the following calculated column should give you the correct total value for each Cust:
Note_Cnt Column =
CALCULATE(
SUM( Note_Usage[NoteCount] ),
ALLEXCEPT(
Note_Usage,
Note_Usage[Cust]
)
)
For the next step just make sure that you take the MAX and not the SUM per Customer.
Or you skip the step and get everything in one calculated column:
Patient Column =
VAR vNoteCount =
CALCULATE(
SUM( Note_Usage[NoteCount] ),
ALLEXCEPT(
Note_Usage,
Note_Usage[Cust]
)
)
RETURN
IF(
vNoteCount >= 200,
"Seeing Patients",
"Not Seeing Patients"
)
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 30 | |
| 28 | |
| 23 | |
| 21 | |
| 19 |
| User | Count |
|---|---|
| 39 | |
| 31 | |
| 18 | |
| 17 | |
| 15 |