Forum Discussion
undefined
Hi,
I have added screenshot please have a look, and let me know asap!!
Thank you for helping!!
Hi AditiGupta_ ,
Try to update DAX measures by :
1. Output Hours (Final): add a conditional check
Output Hours (Final) =
VAR _InputHrs = CALCULATE(SUM('Input Hrs'[Input Hours]))
VAR _OutputHrs = SUM('Warehouse PRODROUTETRANS'[Output Hours])
RETURN
IF(
NOT ISBLANK(_InputHrs) && _InputHrs > 0,
_OutputHrs,
BLANK()
)
2. Input Hours (Final): stays clean
Input Hours (Final) =
VAR _InputHrs = CALCULATE(SUM('Input Hrs'[Input Hours]))
RETURN
IF(
NOT ISBLANK(_InputHrs) && _InputHrs > 0,
_InputHrs,
BLANK()
)
3. Prod Eff: the critical fix
Prod Eff =
VAR _InputHrs = [Input Hours (Final)]
VAR _OutputHrs = [Output Hours (Final)]
RETURN
IF(
ISBLANK(_InputHrs) || _InputHrs = 0,
0, -- No input hours → show 0
DIVIDE(_OutputHrs, _InputHrs, 0)
)
4. Total Output Hours for KPI Card (only counts valid entities)
Total Output Hours (KPI) =
SUMX(
VALUES('Warehouse PRODROUTETRANS'[Entity]), -- loop per entity
VAR _InputHrs = CALCULATE(SUM('Input Hrs'[Input Hours]))
VAR _OutputHrs = CALCULATE(SUM('Warehouse PRODROUTETRANS'[Output Hours]))
RETURN
IF(
NOT ISBLANK(_InputHrs) && _InputHrs > 0,
_OutputHrs,
BLANK() -- excludes entity with no input hours from total
)
)
Hope this helps! Please, don't forget to accept as solution ✅ and thumbs up 👍 in order to keep helping others.
Best regards,
Oussama (Data Consultant - Expert Fabric & Power BI)