Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
@ihmerr2c
Try the following version:
AllocatedAmountp2 =
SUMX (
ADDCOLUMNS (
SUMMARIZE (
'mediware vw_EMRToBilling',
'mediware dimFacility'[FacilityName],
'mediware vw_EMRToBilling'[bsr_Visits],
'mediware vw_EMRToBilling'[feeschedc],
'mediware vw_EMRToBilling'[Contractper]
),
"TotalAmount", [TotalAmountMeasure],
"ServedHours", [ServedHoursMeasure],
"TotalServedHoursWeek", [TotalServedHoursWeekMeasure]
),
VAR __TotalAmount = [TotalAmount]
VAR __Contractper = [Contractper]
RETURN
IF (
[bsr_Visits] > 1,
__TotalAmount * DIVIDE ( [ServedHours], [TotalServedHoursWeek] ) * __Contractper,
IF ( [feeschedc] = "Unknown", __TotalAmount * 1, __TotalAmount * __Contractper )
)
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Avoid Using SUMMARIZE in CALCULATE: The SUMMARIZE function can be computationally expensive, especially if your data table is large. Instead, try to create separate measures for aggregated calculations and use them in your main measure.
Break Down the Measure: Try to break down the measure into smaller parts and then combine them. For instance, create separate measures for TotalAmount, ServedHours, and TotalServedHoursWeek and then use them in your main measure.
Optimize IF Conditions: Instead of using nested IF conditions, try to use logical functions like SWITCH.
Here's a simplified version of your measure:
AllocatedAmountp2 =
VAR TotalAmountValue = [TotalAmountMeasure]
VAR ServedHoursValue = [ServedHoursMeasure]
VAR TotalServedHoursWeekValue = [TotalServedHoursWeekMeasure]
RETURN
CALCULATE (
SUMX (
'mediware vw_EMRToBilling',
VAR CalculatedAmount =
SWITCH (
TRUE (),
'mediware vw_EMRToBilling'[bsr_Visits] > 1, TotalAmountValue * DIVIDE(ServedHoursValue, TotalServedHoursWeekValue) * 'mediware vw_EMRToBilling'[Contractper],
'mediware vw_EMRToBilling'[feeschedc] = "Unknown", TotalAmountValue * 1,
TotalAmountValue * 'mediware vw_EMRToBilling'[Contractper]
)
RETURN
CalculatedAmount
)
)
Please note the following:
If the performance issue persists, you might need to look into optimizing your data model, considering hardware resources, or restructuring your data.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 11 | |
| 6 | |
| 5 |