Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
8 |