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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
CarlosOlmos29
Helper I
Helper I

Add two measures after a date

Hello Power BI Community.

I am trying to sum two DAX measures, but I need them to be summed only after a certain date (after the line in the image). I tried with an if but it didn't work. I would appreciate if you can give me some ideas to solve this problem.

The measures are SUM OIL REAL(BLS) and FCST OIL.

Thanks in advance for your support.

CarlosOlmos29_0-1714402824512.png

 

7 REPLIES 7
v-yilong-msft
Community Support
Community Support

Hi @CarlosOlmos29 ,

I create a table and two measures as you mentioned.

vyilongmsft_0-1714446461085.png

Then I create a measure and here is the DAX code.

 

Measure = 
CALCULATE (
    'Table'[Measure1] + 'Table'[Measure2],
    FILTER ( 'Table', 'Table'[Date] > DATE ( 2024, 1, 2 ) )
)

 

vyilongmsft_1-1714446578994.png

 

 

 

Best Regards

Yilong Zhou

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

Tahreem24
Super User
Super User

@CarlosOlmos29 You can use the below measure to achieve your result, in my case I took the date after 2-Jan-2024, likewise you can write your expected date value.

Measure = CALCULATE(SUM('Table'[Value1])+SUM('Table'[Value2]),FILTER('Table','Table'[Date]>DATE(2024,1,2)))

 

Tahreem24_0-1714405104446.png

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

It worked with the date, but it is not adding up the measurements. It looks like the screenshot below.

CarlosOlmos29_0-1714406038926.png

 

This is the measure I am using:

Real + fcst = CALCULATE([SUMA OIL REAL(BLS)] + [FCST OIL],FILTER(Consolidado, Consolidado[VOLUME_DATE] > MAX(Real[VOLUME_DATE])))
I think it is not adding up because the SUMA OIL REAL(BLS) data is being repeated after March 15. Actually there is no more data entered after that date. We could modify the measurement so that the last data of March 15 of SUMA OIL REAL is added with the one of April 15 of FCST OIL.
Housden996
Helper II
Helper II

I may be miss understanding but can you not just add a date filter?

How? I tried to use the next measure:

Real + fcst = CALCULATE([SUMA OIL REAL(BLS)] + [FCST OIL],Consolidado[VOLUME_DATE] >= [FechaCorte])
([FechaCorte] is the date from which I want the measurements to start adding up) 
But the measurement gives me an error

So it looks like its pulling in a list of dates try using the ISONORAFTER function:
ISONORAFTER function (DAX) - DAX | Microsoft Learn

If you can help me with the measure I would aprecciate it 🙂 I don't know how to use it in this case

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.