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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Show Total amount from the beginning irrespective of date slicer

Hi All,

Following is my sample data,

Product     Date                Amount      

A             10-01-2020        1000

A             02-02-2020          500

A             21-03-2020          700

B             19-01-2020          500
B             11-02-2020        1500
B             23-03-2020          400

 

In my table visual i need these columns as follows and this my expected output,

Product   Net Amount  Balance

A                 500              1500

B                1500             2000

In the report, i have selected range of date in between date slicer as from 01-02-2020 to 29-02-2020

 

Net Amount is the sum of Amount between the selected date range. But, Balance is the sum of amount from the start date (first non blank value in the date column ie..10-01-2020) to the selected max date (ie...29-02-2020) in the between date slicer.

 

I nedd a dax formula (measure) to calculate Balance of Amount.

 

Thanks in advance

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

calculate(sum(Table[Value]), filter(all(Table), Table[Product] = max(Table[Product])))

 

If date is coming from a date table joined to this

try like

calculate(sum(Table[Value]), all(Date))

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

View solution in original post

littlemojopuppy
Community Champion
Community Champion

Hi @Anonymous 

 

Try these

Total Amount = 
    CALCULATE(
        SUM(Amounts[Amount]),
        VALUES('Calendar'[Date])
    )

Product Total = 
    CALCULATE(
        SUM(Amounts[Amount]),
        FILTER(
            ALL(Amounts[Product]),
            Amounts[Product] = SELECTEDVALUE(Products[Product])
        ),
        FILTER(
            ALL('Calendar'[Date]),
            'Calendar'[Date] <= MAX('Calendar'[Date])
        )
    )

Net Amount = [Product Total] - [Total Amount]

 

Results...

littlemojopuppy_0-1609859487277.png

 

View solution in original post

3 REPLIES 3
littlemojopuppy
Community Champion
Community Champion

Hi @Anonymous 

 

Try these

Total Amount = 
    CALCULATE(
        SUM(Amounts[Amount]),
        VALUES('Calendar'[Date])
    )

Product Total = 
    CALCULATE(
        SUM(Amounts[Amount]),
        FILTER(
            ALL(Amounts[Product]),
            Amounts[Product] = SELECTEDVALUE(Products[Product])
        ),
        FILTER(
            ALL('Calendar'[Date]),
            'Calendar'[Date] <= MAX('Calendar'[Date])
        )
    )

Net Amount = [Product Total] - [Total Amount]

 

Results...

littlemojopuppy_0-1609859487277.png

 

Assumes you have both a date table and a master products table.  You can download the pbix file here.

amitchandak
Super User
Super User

@Anonymous , Try a measure like

 

calculate(sum(Table[Value]), filter(all(Table), Table[Product] = max(Table[Product])))

 

If date is coming from a date table joined to this

try like

calculate(sum(Table[Value]), all(Date))

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

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.