Running Total of selected Date range

  • Running Total of selected Date range

    Posted by DSC Communities on July 7, 2020 at 4:31 pm
    • Shailesh Kanse

      Member

      July 7, 2020 at 4:31 PM

      Hi Team,
      I am trying to calculate sum of “Pending Questions” in Matrix Visual. Here I wanted to show “Student” and “Max date Selected” in row and sum of “Pending Questions” in value of matrix visual. File attached below.If someone could help me that would be great.

      ——————————
      Shailesh Kanse
      Senior BI Developer
      ——————————

    • Alberto Gastaldo

      Member

      July 8, 2020 at 3:11 AM

      HiĀ ShaileshĀ 
      could you please clarify your request ?

      Do you need something like this ?

      StudendIDĀ  Ā  Max dateĀ  Ā Total

      —————————————-
      1641Ā  Ā  Ā 10/05/2020Ā  Ā  Ā 90
      1746Ā  Ā  Ā 10/05/2020Ā  Ā  Ā 155
      1808Ā  Ā  Ā 10/05/2020Ā  Ā  Ā 227

      I attached the modified file with the correct measures:

      Basically I suggest you to:
      1) add a calendar table to your model: this is a best practice any time you play with datesĀ 

      2) create a base measure that show the number of pending questions (i called it # of pending questions)

      # of pending questions = SUM(StudentPerformance[Pending Qustions])

      3) create a running total measure: what you need is basically REMOVE the filter on student and get the number of questions for all student less or equal to the current student

      # of pending running total =
      Ā  Ā Var currentStudend = SELECTEDVALUE(StudentPerformance[Student ID])
      Ā  Ā RETURN
      Ā  Ā CALCULATE(
      Ā  Ā  Ā  Ā [# of pending questions],
      Ā  Ā  Ā  Ā StudentPerformance[Student ID] <= currentStudend,
      Ā  Ā  Ā  ALL(StudentPerformance[Student ID])
      )

      ——————————
      Alberto Gastaldo
      SQL Server & BI sernior consultant and trainer
      ——————————
      ——————————————-

    • Alberto Gastaldo

      Member

      July 8, 2020 at 3:25 AM

      Here is the new PIBX file
      Let me know.

      Alberto

      ——————————
      Alberto Gastaldo
      SQL Server & BI sernior consultant and trainer
      ——————————
      ——————————————-

    • Shailesh Kanse

      Member

      July 25, 2020 at 2:50 AM

      HiĀ Alberto,
      Thanks for your help. This is working for me.

      ——————————
      Shailesh Kanse
      Senior BI Developer
      ——————————
      ——————————————-

    DSC Communities replied 5 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Running Total of selected Date range’ 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!