Forum Discussion

CraigM4's avatar
CraigM4
New Member
3 years ago

Quarter to date calculation using month slicer as a reference point

Good evening

 

I am not new to power bi but just can't seem to find a way to do this. I have a simple dashboard set up (dummy data extracts and pbix attached). There are two visuals controlled by one month slicer, each visual looking at a different year. My issue is that I need to be able to report on a qtr to date basis in both years, but using the slicer as a reference point. eg) if searching for month 6, then the figures should relate to that whole qtr, so months 4, 5 and 6. If searching for month 5, then only months 4 and 5 should be included.

I have tried using a running total, additional columns to group data together, as well as All, All Selected and All Except. In essence I get to a point where all the figures by month are correct but cannot create the next step to reference the slicer and add month totals together where needed. Any help would be appreciated, it feels like I've spent far too long on this already. 

The two tables are linked single direction from date table.

 

 

 

 

 

 

DateYearQtrMthValue
01/01/202220221149535
02/01/20222022118045
03/01/20222022118857
04/01/202220221134820
05/01/20222022119433
06/01/202220221147808
07/01/20222022117870
08/01/202220221129341
09/01/202220221138373
10/01/202220221138977
DateMthYear Diff
01/01/202211
02/01/202211
03/01/202211
04/01/202211
05/01/202211
06/01/202211
07/01/202211
08/01/202211
09/01/202211
10/01/202211
11/01/202211
12/01/202211
13/01/202211

2 Replies

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

    CraigM4 Not sure I completely understand but perhaps something like the following:

    Measure = 
      VAR __Month = MAX('Actual'[Mth])
      VAR __Quarter = MAX('Actual'[Qtr])
      VAR __Table = FILTER(ALL('Actual'), [Qtr] = __Quarter && [Mth] <= __Month)
      VAR __Result = SUMX( __Table, [Value] )
    RETURN
      __Result
    
    • CraigM4's avatar
      CraigM4
      New Member

      Thanks Greg, I'll give that a try and let you know.