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
bkoenen
Helper I
Helper I

Slicer that summerize every month with the next month

Hello,

 

I have got a table with stock values, these are purchuse orders with a date and a value. Now I have a slicer in my dashboard where I can select the month's. But the value it shows is from the first of the chosen month till the last date of that month. But I want that it summerize from the first month till the last month.

 

Stock data

January 100,00

February 200,00

March 150,00

 

Example how it should be:

When I select in the slicer the months January and February the result should be like this:

January 100,00

February 300,00     result comes from (January 100,00 + February 200,00)

 

When I select in the slicer the months January and February and March the result should be like this:

January 100,00

February 300,00    result comes from (January 100,00 + February 200,00)

March 450,00        result comes from(January 100,00 + February 200,00 + March 150,00)

 

 

Does anyone have a solution for this?

 

With kind regards,

 

Björn

1 ACCEPTED SOLUTION

Hi @bkoenen ,

 

This is not a calculated column this is a Measure.

 

Measures are calculated based on context so when you get it on your visualizations the date context is picked up for the calculation.


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

4 REPLIES 4
MFelix
Super User
Super User

Hi @bkoenen ,

 

You can use the time intelligence functions:

 

Total = CALCULATE ( SUM(Table[StockValue]), DATESYTD(Table[Date]))

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



Hello Miguel,

 

I added a column with your Dax formula, but I get exact the same result as before.

 

Formula:

Voorraadwaarde Calc = CALCULATE ( SUM('In en verkoop'[Voorraad waarde]), DATESYTD('In en verkoop'[Leverdatum].[Date]))

 

I would like to have that November gives the value 5.062.231,06 (Sum=October + November)

bkoenen_0-1637926091466.png

 

With kind regards,

 

Björn

Hi @bkoenen ,

 

This is not a calculated column this is a Measure.

 

Measures are calculated based on context so when you get it on your visualizations the date context is picked up for the calculation.


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



Hi Miguel,

 

I made a measure with the DATESYTD and it works fine, thank you.

 

Kind regards,

 

Björn

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.