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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mciani
Regular Visitor

Displaying the sum of most recent values in a table

Hi everyone,

 

i have tried everything with very poor results!

I'm new to PowerBI and I'm just trying to build a nice report. I did great progresses but I'm stuck trying to display a number on a visual.

I have a table with 3 columns showing total sales [salesamount] per customer group [customer] by date [date].

I want to show the sum of previuos day sales, basically one record per [customer group] with the sum of [salesamount] filtered by the max of [date]...

 

Anyone can help? I assume it's easy... but all I got so far is either a blank resutl or a result showing the sum of all data in the table...

 

Thanks a lot!!!

Marco

 

 

1 ACCEPTED SOLUTION

CALCULATE (
       SUM(Portafoglio-1),
    FILTER(ALL(Your Table Name), Your Table Name'[data] = TODAY()))

You may try this measure. It worked on my side.

or this one.

CALCULATE ( SUM(Portafoglio-1), FILTER(ALL(Your Table Name), Your Table Name'[data] = MAX(Your Table Name'[data])))

View solution in original post

5 REPLIES 5
mussaenda
Super User
Super User

Hi,

Please provide a sample data or more details and your expected output to answer your questions. Thank you

Hi! Thanks for your replay.

 

Below you can see my dataset. What I would like to have is a new measure that is only taking into account the rows where the column data is the most recent one. In this case, I need to have only the records of the 28/05/2019. Daily data is appended to this table, so I need a dynamic formula that filters on most recent date of this table.

 

Marco

Capture.JPG

CALCULATE (
       SUM(Portafoglio-1),
    FILTER(ALL(Your Table Name), Your Table Name'[data] = TODAY()))

You may try this measure. It worked on my side.

or this one.

CALCULATE ( SUM(Portafoglio-1), FILTER(ALL(Your Table Name), Your Table Name'[data] = MAX(Your Table Name'[data])))

Hey, just to let you know that I did it...

I have removed the ALL from your suggestion and it worked!!!

 

Thanks a lot for your very valuable input!!!

Marco

WOW!!!

Thank you so much... really close to my goal now.

Can I exploit your knowledge a bit more?

Look below. I have created the new measue called "Inserito Daily" using your suggestion. The total is exactely what I was expecting, the last issue I have is that the value on the rows is being repeted insted of allocated to the correct customer group. Any clue on why this is happening and how to fix it?

 

 

Capture2.JPG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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