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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
adityavighne
Continued Contributor
Continued Contributor

Max value total in table

Hi,

 

I have table for category and sales. I want to dispaly last dat sales value and sum in table.

 

Category    Sales  Date 

A                100      1jan

B                200       1jan

A                300       2jan

B                100        2jan

 

output - table must show 

A                300       2jan

B                100        2jan

total        400

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hello, @adityavighne

According to your description, I created data to reproduce your scenario. The pbix file is attached at the end.

Mesa:

c1.png

You can create two measures as follows.

SumSales = 
SUMX(
    SUMMARIZE(
        'Table',
        'Table'[Category],
        "Result1",
        CALCULATE(
            SUM('Table'[Sales]),
            FILTER(
                ALLEXCEPT('Table','Table'[Category]),
                [Date]=MAX('Table'[Date])
            )
        )
    ),
    [Result1]
)
Latest Date = MAX('Table'[Date])

Result:

c2.png

Best regards

Allan

If this post helps,then consider Accepting it as the solution to help other members find it faster.

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hello, @adityavighne

According to your description, I created data to reproduce your scenario. The pbix file is attached at the end.

Mesa:

c1.png

You can create two measures as follows.

SumSales = 
SUMX(
    SUMMARIZE(
        'Table',
        'Table'[Category],
        "Result1",
        CALCULATE(
            SUM('Table'[Sales]),
            FILTER(
                ALLEXCEPT('Table','Table'[Category]),
                [Date]=MAX('Table'[Date])
            )
        )
    ),
    [Result1]
)
Latest Date = MAX('Table'[Date])

Result:

c2.png

Best regards

Allan

If this post helps,then consider Accepting it as the solution to help other members find it faster.

ryan_mayu
Super User
Super User

@adityavighne 

you can try to create a measure

Measure 2 = CALCULATE(sum('Table'[SALES]),FILTER('Table','Table'[DATE]=max('Table'[DATE])))

1.png





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

Proud to be a Super User!




amitchandak
Super User
Super User

@adityavighne , Take Category and these two measures in the visual

MAx date = max(Table[Date])
Total sales = sumx(values(Table[Category]), lastnonblankvalue(Table[Date],sum(Table[Sales])))

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.