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.
I will need your support to improve performance for the below measure formula. This is taking too much time to execute.
ActualEqHours = CALCULATE (
SUMX ( SelfService_Plan_DailyPlanHour, IF(SelfService_Plan_DailyPlanHour[DailyPlanStatusId]=1,0,
IF(SelfService_Plan_DailyPlanHour[DailyPlanStatusId]=2,SelfService_Plan_DailyPlanHour[ActualStdHours],
if(SelfService_Plan_DailyPlanHour[DailyPlanStatusId]=3,SelfService_Plan_DailyPlanHour[ApprovedStdHours],SelfService_Plan_DailyPlanHour[ApprovedStdHours])))),
FILTER ( SelfService_Plan_DailyPlanHour,
SelfService_Plan_DailyPlanHour[IsActive_Hour]
&& SelfService_Plan_DailyPlanHour[IsLatest]
&& SelfService_Plan_DailyPlanHour[ResourceTypeDescription]="Equipment"
&& (SelfService_Plan_DailyPlanHour[DailyPlanStatusDescription]="Approved" || SelfService_Plan_DailyPlanHour[DailyPlanStatusDescription]="Awaiting Approval")
&& RELATED(SelfService_Control_CostItem[Is_terminal])
&& SelfService_Plan_DailyPlanHour[ProjectId]=RELATED(SelfService_Core_Project[Project_id])
),USERELATIONSHIP(SelfService_Plan_DailyPlanHour[ProjectIdEquipDisplay], InEightProjEquipmentStagingTable[ProjectIdEquipmentDisplay]))
Solved! Go to Solution.
Hi @jesly_ajin ,
Variables can be defined, I modified Dax like this, you can add it to your PBIX file to view the time spent:
ActualEqHours =
var _1=
SWITCH(
TRUE(),
SelfService_Plan_DailyPlanHour[DailyPlanStatusId]=1,0,
SelfService_Plan_DailyPlanHour[DailyPlanStatusId]=2,SelfService_Plan_DailyPlanHour[ActualStdHours],
SelfService_Plan_DailyPlanHour[DailyPlanStatusId]=3,SelfService_Plan_DailyPlanHour[ApprovedStdHours],
SelfService_Plan_DailyPlanHour[ApprovedStdHours])
var _2=SUMX(SelfService_Plan_DailyPlanHour,_1)
return
CALCULATE ( _2,
FILTER ( SelfService_Plan_DailyPlanHour,
SelfService_Plan_DailyPlanHour[IsActive_Hour]
&& SelfService_Plan_DailyPlanHour[IsLatest]
&& SelfService_Plan_DailyPlanHour[ResourceTypeDescription]="Equipment"
&& (SelfService_Plan_DailyPlanHour[DailyPlanStatusDescription]="Approved" || SelfService_Plan_DailyPlanHour[DailyPlanStatusDescription]="Awaiting Approval")
&& RELATED(SelfService_Control_CostItem[Is_terminal])
&& SelfService_Plan_DailyPlanHour[ProjectId]=RELATED(SelfService_Core_Project[Project_id])
),USERELATIONSHIP(SelfService_Plan_DailyPlanHour[ProjectIdEquipDisplay], InEightProjEquipmentStagingTable[ProjectIdEquipmentDisplay]))
Here are the related Dax function optimization documents, I hope it will be helpful to you:
https://maqsoftware.com/expertise/powerbi/dax-best-practices
https://community.powerbi.com/t5/Desktop/DAX-optimization/td-p/946984
https://docs.microsoft.com/en-us/power-bi/guidance/power-bi-optimization
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jesly_ajin ,
Variables can be defined, I modified Dax like this, you can add it to your PBIX file to view the time spent:
ActualEqHours =
var _1=
SWITCH(
TRUE(),
SelfService_Plan_DailyPlanHour[DailyPlanStatusId]=1,0,
SelfService_Plan_DailyPlanHour[DailyPlanStatusId]=2,SelfService_Plan_DailyPlanHour[ActualStdHours],
SelfService_Plan_DailyPlanHour[DailyPlanStatusId]=3,SelfService_Plan_DailyPlanHour[ApprovedStdHours],
SelfService_Plan_DailyPlanHour[ApprovedStdHours])
var _2=SUMX(SelfService_Plan_DailyPlanHour,_1)
return
CALCULATE ( _2,
FILTER ( SelfService_Plan_DailyPlanHour,
SelfService_Plan_DailyPlanHour[IsActive_Hour]
&& SelfService_Plan_DailyPlanHour[IsLatest]
&& SelfService_Plan_DailyPlanHour[ResourceTypeDescription]="Equipment"
&& (SelfService_Plan_DailyPlanHour[DailyPlanStatusDescription]="Approved" || SelfService_Plan_DailyPlanHour[DailyPlanStatusDescription]="Awaiting Approval")
&& RELATED(SelfService_Control_CostItem[Is_terminal])
&& SelfService_Plan_DailyPlanHour[ProjectId]=RELATED(SelfService_Core_Project[Project_id])
),USERELATIONSHIP(SelfService_Plan_DailyPlanHour[ProjectIdEquipDisplay], InEightProjEquipmentStagingTable[ProjectIdEquipmentDisplay]))
Here are the related Dax function optimization documents, I hope it will be helpful to you:
https://maqsoftware.com/expertise/powerbi/dax-best-practices
https://community.powerbi.com/t5/Desktop/DAX-optimization/td-p/946984
https://docs.microsoft.com/en-us/power-bi/guidance/power-bi-optimization
Best Regards,
Liu Yang
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 |
---|---|
107 | |
99 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |