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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Return values without the last date in data

Hi guys, need help here

 

My last date of data is not today. 

nicholaskong_0-1602061820335.png

I have a slicer that is after x date to the latest production date. However, In my values I do not wish to display (it is showing a large dip at the end because the data is incomplete mid-day)

nicholaskong_0-1602062161435.png

 

I am trying to find the difference between the dates after, and the selected date, while excluding the most recent date.

This is my formula without excluding the most recent date - which is not today() but a date from the data source

DeltaProduction = SUM(table[production]) - CALCULATE(SUM(table[production]), FIRSTDATE(ALLSELECTED(Table[productionDate])))

 

3 REPLIES 3
Anonymous
Not applicable

Hello @nicholaskong ,

In my opinion, in order to avoid a big fall, you want to sum the production after the selected date and calculate the difference between the selected one and the sum, right?

You can use the following formula:

DeltaProduction =
VAR _total =
    CALCULATE (
        SUM ( 'Table'[Production] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[ProductionDate] > MIN ( 'forSlicer'[ProductionDate] )
                && 'Table'[ProductionDate] < MAX ( 'forSlicer'[ProductionDate] )
        )
    )
RETURN
    IF (
        MAX ( 'Table'[ProductionDate] ) < MIN ( forSlicer[ProductionDate] ),
        SUM ( 'Table'[Production] ) - _total,
        0
    )

10.14.1.PNG

Here is the mypbix file.

Have I answered your question? Please mark my answer as a solution. Thanks a lot.
If not, load some insensitive data samples and expected output.

Best regards
Eyelyn Qin

amitchandak
Super User
Super User

@Anonymous , You can try a new measure like

 

new measure =
var _max =maxx(allselected(date), Date[date])
return
calculate([measure], filter(Date, Date[date] <_max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 

nicholaskong_0-1602064306552.png


Graph comes out bad 😕

 

DeltaProduction = SUM(Genscape_HFOPM[Production]) - CALCULATE(sum(Genscape_HFOPM[Production]), FIRSTDATE(ALLSELECTED(Genscape_HFOPM[ProductionDate])))

DeltaWOMostRecent =
VAR Maximum = MAXX(ALLSELECTED(Genscape_HFOPM), Genscape_HFOPM[ProductionDate])
Return
CALCULATE([DeltaProduction], FILTER(Genscape_HFOPM, Genscape_HFOPM[ProductionDate]< Maximum))



 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors