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
Pepperi
Frequent Visitor

Calculate Max value of a running total

Hi,

 

I'm experimenting with PowerBI, which is a fantastic tool and have a great community.

I have a table of deals per customer. We are selling our products as license per user, therefore a customer might add or reduce the number of licenses during its global subscription.

I've created a cumulative total measure and i want now to be able to determine for each customer what was its highest subscription since it's a customer.

For instance, all the deals in the large red rectangle relate to one customer. The highest value is in the small red rectangle.

I'm stuck because the running total is a measure, and the MAX function requires a column.

 

Can you help me on this one?

Thanks in advance

Screenshot_1.png

6 REPLIES 6
v-yulgu-msft
Employee
Employee

Hi @Pepperi,

 

Please refer to below measures:

Rank =
RANKX (
    ALLEXCEPT ( 'Test Table', 'Test Table'[Custom] ),
    [OPP MRR USD running total],
    ,
    DESC,
    DENSE
)

Max running total =
CALCULATE (
    [OPP MRR USD running total],
    FILTER ( ALLEXCEPT ( 'Test Table', 'Test Table'[Custom] ), [Rank] = 1 )
)

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yulgu-msft

 

Hi Yuliana, thank you very much for your reply.

In your example, assuming the deals are sorted by date, I don't understand the cumulative total.
The figures should be:

Screenshot_2.png

 

Anyway, i tried your solution but the results are not as expected:
Screenshot_3.png

Hi @Pepperi,

 

In your scenario, how did you calculate the Running Total values? Also, are records sorted by date in your scenario?

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft,

 

Sorry for the late reply.

My issue was solved. Thanks for your help!

Hi @Pepperi how did you end up solving this?

Can you share the DAX for this problem? I'm running into the same issue

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.