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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
NewbieJono
Post Partisan
Post Partisan

Calculating based on Max Date

Hello, i am looking to calculate the total volume by each date for the Max date of receipt only:

 

example below.

 

Capture.PNG

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @NewbieJono 

Please try this:

Measure1 = 
VAR MaxDate =
    CALCULATE ( MAX ( 'Table'[Receipt date] ), ALL ( 'Table'[Receipt date] ) )
RETURN
    SUMX (
        VALUES ( 'Table'[Date] ),
        CALCULATE (
            SUM ( 'Table'[Randvalues] ),
            FILTER ( 'Table', 'Table'[Receipt date] = MaxDate )
        )
    )

danextian_0-1731496870170.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

5 REPLIES 5
123abc
Community Champion
Community Champion

First you Identify the Max DateOfReceipt with below Dax:

MaxDateOfReceipt = MAX('Table'[DateOfReceipt])

 

Then to Calculate Total Volume for Each Date (filtered by Max DateOfReceipt):

TotalVolumeForMaxDateOfReceipt =
CALCULATE(
SUM('Table'[Volume]),
'Table'[DateOfReceipt] = [MaxDateOfReceipt]
)

 

his will give you the result similar to the example in your screenshot, where it shows total volumes only for the entries with the maximum DateOfReceipt. Let me know if you need further customization!

danextian
Super User
Super User

Hi @NewbieJono 

Please try this:

Measure1 = 
VAR MaxDate =
    CALCULATE ( MAX ( 'Table'[Receipt date] ), ALL ( 'Table'[Receipt date] ) )
RETURN
    SUMX (
        VALUES ( 'Table'[Date] ),
        CALCULATE (
            SUM ( 'Table'[Randvalues] ),
            FILTER ( 'Table', 'Table'[Receipt date] = MaxDate )
        )
    )

danextian_0-1731496870170.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
shafiz_p
Super User
Super User

Hi @NewbieJono  Try this:

TotalVolume= 
VAR MaxDateOfReceipt = 
    CALCULATE(
        MAX('Table'[DateOfReceipt]),
        ALLEXCEPT('Table', 'Table'[Date])
    )
RETURN
    CALCULATE(
        SUM('Table'[Volume]),
        'Table'[DateOfReceipt] = MaxDateOfReceipt
    )

 

Output:

shafiz_p_0-1731496794803.png

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

Best Regards,
Shahariar Hafiz

FreemanZ
Super User
Super User

hi @NewbieJono ,

 

Try to plot a visual with date column and a measure like:

measure =

VAR _maxdatereceipt=MAX(data[DateofReceipt])

VAR _result=

SUMX(

    FILTER(

        data,

        data[DateofReceipt] = _maxdatereceipt

    ),

    data[volumn]

)

RETURN _result

mh2587
Super User
Super User

Total Volume for Max Receipt Date = //try this one
VAR MaxReceiptDate = MAX('TableName'[ReceiptDate])
RETURN
    CALCULATE(
        SUM('TableName'[Volume]),
        'TableName'[ReceiptDate] = MaxReceiptDate
    )

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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