Forum Discussion

sakuragihana's avatar
sakuragihana
Icon for Helper IV rankHelper IV
3 years ago

Need help for fixing dax not calculating correct

Hello everyone,

I have a dax for calculating Standard teaching time for teacher.

 

Standard Teaching Time =
VAR teacher_code = SELECTEDVALUE('List Class Schedule Teacher'[TeacherCode])
VAR filter_area = CALCULATETABLE('List Class Schedule Teacher', 'List Class Schedule Teacher'[TeacherCode] = teacher_code)
VAR part_time_distribution =
    SUMX(
        FILTER(filter_area, 'List Class Schedule Teacher'[TeacherContractType] = "Part Time" && 'List Class Schedule Teacher'[StartTime] <> 0),
        'List Class Schedule Teacher'[TimeStandard] * [DayofWorking]
    )

VAR full_time_distribution =
    SUMX(
        FILTER(filter_area, 'List Class Schedule Teacher'[TeacherContractType] = "Full Time" &&'List Class Schedule Teacher'[StartTime] <> 0),
        'List Class Schedule Teacher'[TimeStandard] * [DayofWorking]
    )

RETURN part_time_distribution + full_time_distribution
 
 
But in this visual this dax calculate Standard Teaching Time was not correct :

 

The correct visual is :Standard teaching time = 31.44

 

I have a Power BI in this link : https://drive.google.com/file/d/1OSZwDrcJIxzYbuxVwf9NwTzPy94ibFyk/view?usp=sharing 

Please help me to fix this dax !

3 Replies

  • Hi,

    Explain the question in simple language rather than just posting a DAX formula.  You are more likely to get a respone.

    • sakuragihana's avatar
      sakuragihana
      Icon for Helper IV rankHelper IV

      Hi Ashish_Mathur ,

       

      Standard Teching Time = Part time + Full Time

      Part Time is calculating by Time Standard for contract Part time and the same as for full time. But my dax is calculating that is not correct. Can you help me ?

       

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

        I still do not understand.  Someone else who does will help you.