Forum Discussion

arif_tsrm's avatar
arif_tsrm
Helper I
2 years ago

Monthly line chart calculation

I have two fact table( FactDeskCapacity, FactStaffAttendance) connected with Dim Calender Table using key MonthName,
Have two measure "Desk Capacity" is count of Desk from FactDeskCapacity, and "Total Staff Attendance" is DistinctCount of Date from FactStaffAttendance, please see the picture, now I want to show in a monthly line chart, in a month how many days "Total Staff Attendance" is greater than "Desk Capacity", for example the result will be 2 for february ( 7 , 9 th February)

6 Replies

  • Uzi2019's avatar
    Uzi2019
    Community Champion

    Hi arif_tsrm 

    please create the follwoing measure
    Count day= CALCULATE( COUNT(date), FILTER('Table',[measure1]>[measure2]))


    If I answered your question please give kudos and accept it as a solution!

     

     

    • arif_tsrm's avatar
      arif_tsrm
      Helper I

      Thank you for you reply, I have using your  above measure but not working , please see my below measure

      test = var tst=CALCULATE(COUNT(FactStaffAttendance[DateOnly]),FILTER(FactStaffAttendance, [Total Staff Attendance]>[Desk Capacity]))
      return tst
      • Uzi2019's avatar
        Uzi2019
        Community Champion

        Hi arif_tsrm 
        can you share screen shot what error /answer you are getting??