Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Problem of axis filtering/interraction with Analysis Services

Hello world, I have created a graph that aims to show the daily difference of docs posting among two different months. 
We are using analysis services so what I can do is pretty much limited. 
The problem is this: when I click on the 5th month, on the left hand side , I see data until the 30th day on the right hand side. 
So the 31st day of the 4th month is being filtered so I lose data and the picture is incomplete. 
In general, whenever click on a month with 30 days and the previous month has 31 days, there's loss of data. 
Is there a way to avoid this in Analysis Sercvices (I think this is the most important constraint here) 
Thanks everyone!

8 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous - I'm not quite clear on this, can you post sample data?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Weeeell , as this is on Analysis services I don't think I can upload data simple as that , but I can give you the 2 calcs I've used for Previous and Current month :
      Previous Month

      Previous Month = 
      VAR selectedyear =
          CALCULATE (
              IF (
                  ISFILTERED ( 'Dim - Dates' [Fiscal Year] ),
                  FIRSTNONBLANK (
                      'Dim - Dates'[Fiscal Year],
                       'Dim - Dates'[Fiscal Year]
                  ),
                  YEAR ( TODAY () )
              )
          )
      RETURN
          VAR selectedmonth =
              CALCULATE (
                  IF (
                      ISFILTERED ( 'Dim - Dates'[Fiscal Month Number] ),
                      FIRSTNONBLANK (
                          'Dim - Dates'[Fiscal Month Number],
                          'Dim - Dates'[Fiscal Month Number]
                      ) - 1,
                      MONTH ( TODAY () ) - 1
                  )
              )
          RETURN
              VAR selectedmonth2 =
                  CALCULATE ( IF ( selectedmonth = 0, 12, selectedmonth ) )
              RETURN
                  VAR selectedyear2 =
                      CALCULATE ( IF ( selectedmonth = 0, selectedyear - 1, selectedyear ) )
                  RETURN
                      CALCULATE (
                          [Journal Count Header],
                          'Dim - Dates'[Fiscal Year] = selectedyear2,
                          'Dim - Dates'[Fiscal Month Number] = selectedmonth2,
                          ALLEXCEPT('Dim - Dates', 'Dim - Dates'[Fiscal Day Number]
                      ))

      and current month

      Current Month = 
      VAR selectedyear =
          CALCULATE (
              IF (
                  ISFILTERED ( 'Dim - Dates'[Fiscal Year] ),
                  FIRSTNONBLANK(
                      'Dim - Dates'[Fiscal Year],
                      'Dim - Dates'[Fiscal Year]
                  ),
                  YEAR ( TODAY () )
              )
          )
      RETURN
          VAR selectedmonth =
              CALCULATE (
                  IF (
                      ISFILTERED ( 'Dim - Dates'[Fiscal Month Number] ),
                      FIRSTNONBLANK (
                          'Dim - Dates'[Fiscal Month Number],
                          'Dim - Dates'[Fiscal Month Number]
                      ),
                      MONTH ( TODAY () )
                  )
              )
          RETURN
              CALCULATE (
                  [Journal Count Header],
                  'Dim - Dates'[Fiscal Year] = selectedyear,
                  'Dim - Dates'[Fiscal Month Number] = selectedmonth
              )