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
Anonymous
Not applicable

Sum Total of MAXX

Hello 

 

Just working on getting table to show a correct total on a table visual.

 

The calculation that I am using:

 

Current Price FOB TEMP =
VAR CurrentDate = TODAY()
VAR AllPreviousRatingsTable =
    FILTER (
        'Market Price',
        'Market Price'[Date] <= CurrentDate
    )
VAR PreviousRatingTable =
    TOPN ( 1, AllPreviousRatingsTable, 'Market Price'[Date], DESC )

VAR PreviousRating =
    MAXX ( PreviousRatingTable, 'Market Price'[Price] )
RETURN
SUMX(
    ADDCOLUMNS(
        SUMMARIZE('Market Price','Market Symbol'[Name]),"LastPrice", PreviousRating),
    [LastPrice])
 
But the visual is showing an incorrect total (I have filtered for the three specific names):
Fergo_0-1679457764620.png

 

How can I correct the calculation

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try

Current Price FOB TEMP =
VAR CurrentDate =
    TODAY ()
VAR AllPreviousRatingsTable =
    FILTER ( 'Market Price', 'Market Price'[Date] <= CurrentDate )
VAR PreviousRatingTable =
    TOPN ( 1, AllPreviousRatingsTable, 'Market Price'[Date], DESC )
VAR PreviousRating =
    MAXX ( PreviousRatingTable, 'Market Price'[Price] )
RETURN
    SUMX (
        SUMMARIZE ( 'Market Price', 'Market Symbol'[Name], "LastPrice", PreviousRating ),
        [LastPrice]
    )

Or try

New measure =
SUMX ( 'Market Price', [Current Price FOB TEMP] )

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Anonymous
Not applicable

Hello Stephen

 

I have made the change but seems to be the same outputs:

Fergo_0-1679867532143.png

Seems like everytime I add an extra item to the filter it increases total by $147.50

 

 

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.