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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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