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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
klehar
Helper V
Helper V

Running Total at drill down doesnt work

Hi,

 

I have a bar + line chart that shows Year and Quarter at one level and Week at drill down level.

I want that the running total line that shows right values at the year quarter level shold also show the right values at week level.

How can i make sure i get the right values?

 

klehar_1-1631623625500.png

 

Running total calculation

 

Profit running total in Year Quarter = 
CALCULATE(
	SUM('Table'[Profit]),
	FILTER(
		ALLSELECTED('Table'[Year Quarter]),
		ISONORAFTER('Table'[Year Quarter], MAX('Table'[Year Quarter]), DESC)
	)
)

 

 

Data used above:

 

Year QuarterWeakProfit
2020Q1WK114
2020Q1WK215
2020Q1WK310
2020Q1WK415
2020Q2WK112
2020Q2WK212
2020Q2WK318
2020Q2WK411
2020Q3WK112
2020Q3WK210
2020Q3WK310
2020Q3WK419
2020Q4WK111
2020Q4WK212
2020Q4WK311
2020Q4WK415

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @klehar your issue is that you are making the calculation only at quarter level so you are not abble to get the week level calculation correct.

 

Try to do the following steps:

  • Create a new column:
Year + Q + W = 'Table'[Year Quarter]&'Table'[Weak]

 

  • Change your measure to:
Profit running total in Year Quarter = 
CALCULATE(
	SUM('Table'[Profit]),
	FILTER(
		ALLSELECTED('Table'[Year Quarter], 'Table'[Weak],'Table'[Year + Q + W]),
		ISONORAFTER('Table'[Year + Q + W], MAX('Table'[Year + Q + W]), DESC)
	)
)

 

Result below and in attach PBIX file.

MFelix_0-1631791360464.pngMFelix_1-1631791371732.pngMFelix_2-1631791389341.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @klehar your issue is that you are making the calculation only at quarter level so you are not abble to get the week level calculation correct.

 

Try to do the following steps:

  • Create a new column:
Year + Q + W = 'Table'[Year Quarter]&'Table'[Weak]

 

  • Change your measure to:
Profit running total in Year Quarter = 
CALCULATE(
	SUM('Table'[Profit]),
	FILTER(
		ALLSELECTED('Table'[Year Quarter], 'Table'[Weak],'Table'[Year + Q + W]),
		ISONORAFTER('Table'[Year + Q + W], MAX('Table'[Year + Q + W]), DESC)
	)
)

 

Result below and in attach PBIX file.

MFelix_0-1631791360464.pngMFelix_1-1631791371732.pngMFelix_2-1631791389341.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.