Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Ragnarock1982
Frequent Visitor

Rolling monthly total

Morning all,

 

I'm having an 'issue' with the rolling monthly total on my report.

 

Basically, I have a date slider and a Line & Stacked column chart. When I select dates from the slider the chart is updated BUT it is still showing the running total for the months that I haven't got selected.

EG, If I select JANUARY - APRIL in the slider, it shows ALL months up to december in the chart, but for MAY to DECEMBER it is just the same figure.

 

What I would like, is if I select JAN - APR in the slider then MAY - DEC is blank in the chart.

I have done this on another chart which shows monthly figures (not rolling) and it works fine. ( I have another calculated line in both charts which is calculated up to DEC, to ensure that the months still appear in the charts)

 

I think I'm missing something out of my DAX query, but not sure what. Any thoughts?

 

DAX is:

 

AA running total in Month =
CALCULATE(
 SUM('Balances - Balance Sheet'[AA]),
 FILTER(
  CALCULATETABLE(
   SUMMARIZE(
    'Calendar',
    'Calendar'[Date].[MonthNo],
    'Calendar'[Date].[Month]
   ),
   ALLSELECTED('Balances - Balance Sheet'))
  ,
  ISONORAFTER(
            'Calendar'[Date].[MonthNo], MAX('Calendar'[Date].[MonthNo]), DESC,
   'Calendar'[Date].[Month], MAX('Calendar'[Date].[Month]), DESC
        )
    )
)

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @Ragnarock1982 

You could use this measure as below:

 

New AA running total in Month = 
CALCULATE(
	SUM('Balances - Balance Sheet'[AA]),
	FILTER(
		ALLSELECTED('Calendar'),
		ISONORAFTER('Calendar'[MonthNo], MAX('Calendar'[MonthNo]), DESC)
	)
)

 

or 

AA running total in Date = 
CALCULATE(
	SUM('Balances - Balance Sheet'[AA]),
	FILTER(
		ALLSELECTED('Calendar'[Date]),
		ISONORAFTER('Calendar'[Date], MAX('Calendar'[Date]), DESC)
	)
)

Result:

5.JPG

Best Regards,

Lin

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi, @Ragnarock1982 

You could use this measure as below:

 

New AA running total in Month = 
CALCULATE(
	SUM('Balances - Balance Sheet'[AA]),
	FILTER(
		ALLSELECTED('Calendar'),
		ISONORAFTER('Calendar'[MonthNo], MAX('Calendar'[MonthNo]), DESC)
	)
)

 

or 

AA running total in Date = 
CALCULATE(
	SUM('Balances - Balance Sheet'[AA]),
	FILTER(
		ALLSELECTED('Calendar'[Date]),
		ISONORAFTER('Calendar'[Date], MAX('Calendar'[Date]), DESC)
	)
)

Result:

5.JPG

Best Regards,

Lin

 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-lili6-msft  . . . Perfect!

 

The first DAX worked exactly as needed.

 

Thank you.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.