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
kattlees
Post Patron
Post Patron

Cumulative sum with VALUES filter issue?

I have a deduction table.... I'm trying to get a projected total of the deduction value for the year up to 5000. Once it hits 5000 it should stop.

 

So I have the following:

A column:

DedValue=if(table[code]="125CLD",table[deductionamount],0)   gets me the deduction value for each pay period so far

A measure

DedValueTotal=sum(table[DedValue]) - gets me the deduction value so far

To get projected value = I have 

ProjValueActual = ([DedValueTotal]/[PayDatesDone])*[TotalPayDates]

 

Now i want to do a projected for the year with a maximum of 5000.00

I was thinking of a column of

Proj Ded value = if([ProjValueActual > 5000,5000,[ProjValueActual]) but this is not limiting at 5000. It just shows the ProjValueActual

 

Example:

Employee      Code                Deductionamount         Date

Jim                  125CLD              500                             1/15/17

Sue                  125CLD                 50                            1/15/17

Jim                   125CLD              500                             1/30/17

Sue                  125CLD                 50                            1/30/17

Jim                   125CLD              500                            2/15/17

Sue                   125CLD                50                            2/15/17

 

 

Results should be

Employee                 DeductionAmount           ProjValueActual            Proj Ded Value

Jim                           1500                                        12000                         5000    (need to stop at max value)

Sue                           150                                           1200                         1200

 

4 REPLIES 4
MarkS
Resolver IV
Resolver IV

Hi @kattlees,

 

Would this measure work

ProjDedValue = MIN(5000,[ProjValueActual])

 

 

Gives me the same thing.  😞

Greg_Deckler
Super User
Super User

What are your formulas for PayDatesDone and TotalPayDates?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

In Pay Dates Table

 

PayDatesDone=sum(PayDates[CountPayDates])

CountPayDates=if(PayDates[PayDate]<today(),1,0)

 

PayDatesLeft is a value we enter manually

 

TotalPayDates = PayDatesDone+PayDatesLeft

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.