DAX query showing a different total number

  • DAX query showing a different total number

    Posted by DSC Communities on April 17, 2017 at 2:02 pm
    • Muhammad Akhtar

      Member

      April 17, 2017 at 2:02 PM

      Hi need HELP!!

       

      When I execute a command in Tabular model I get the follwoing numbers

      Sum of present Studnets  161 

      Sum of all enrolled 278

       

      I execute the DAX formula ( i grabbed it using the profiler ) it shows me 

       

      Sum of present Studnets  171 

      Sum of all enrolled 315

       

      My DAX formula is:

       

      EVALUATE
      CALCULATETABLE(
      ADDCOLUMNS(
      KEEPFILTERS(
      SAMPLE(
      3502,
      FILTER(
      KEEPFILTERS(VALUES(‘StudentAttendanceData'[AttendanceDate])),
      OR(
      NOT(
      ISBLANK(CALCULATE(SUM(‘StudentAttendanceData'[All Enrolled])))
      ),
      NOT(
      ISBLANK(CALCULATE(SUM(‘StudentAttendanceData'[Present Students])))
      )
      )
      ),
      ‘StudentAttendanceData'[AttendanceDate],
      1
      )
      ),
      “SumAll_Enrolled”, CALCULATE(SUM(‘StudentAttendanceData'[All Enrolled])),
      “SumPresent_Students”, CALCULATE(SUM(‘StudentAttendanceData'[Present Students]))
      ),

      KEEPFILTERS(
      FILTER(
      KEEPFILTERS(VALUES(‘StudentAttendanceData'[AttendanceDate])),
      AND(
      ‘StudentAttendanceData'[AttendanceDate] >= DATE(2016, 10, 10),
      ‘StudentAttendanceData'[AttendanceDate] < DATE(2016, 10, 11)
      )
      )
      )
      )

      ORDER BY
      ‘StudentAttendanceData'[AttendanceDate]

       

      Any help will be gretaly appreciated.

      Thanks,

      Roomi

    DSC Communities replied 9 years ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘DAX query showing a different total number’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!