0

I want to get the cumulative value of my measure called "Pres_Ecart CA vs Obj" based on the order of another measure called "Var. CA Obj en %".

What I have in my canvas is a matrix where I visualize 3 columns as a hierarchy "A" that contains multiple values of "B", and for each B, I have a value of C .

Please note that I use SAAS live connection with Power so I can't create physical tables.

I tried so many methods like max, sumx. Please note that I only want the sum of the positive values and what I want to do next is to stop the cumulative values at the top 80 % of my measure for each "A".

I tried to explain using Excel to facilitate things Excel example

Cumulativ values of Pres_Ecart CA vs Obj less than 80 % = 
 VAR CurrentSite = SELECTEDVALUE('Axe_SIteInfo'[B])
 VAR CurrentCluster = SELECTEDVALUE('Axe_SIteInfo'[A])
 VAR AllSites =
   FILTER(
    ALLSELECTED('Axe_SIteInfo'),
    'Axe_SIteInfo'[A] = CurrentCluster
        && NOT(ISBLANK([Pres_Ecart CA vs Obj]))
        && [Var. CA Obj en %] <= MAXX(ALLSELECTED('Axe_SIteInfo'), [Var. CA Obj en %])
)
VAR CumulativeValue =
 SUMX(
    FILTER(
        AllSites,
        'Axe_SIteInfo'[B] <= CurrentSite
    ),
    [Pres_Ecart CA vs Obj]
)
RETURN
ABabin
  • 2,724
  • 24
  • 30
  • 1
    I'm sure I'm gonna get slammed for this, but the easiest way is to follow the example on Ferrari & Russo's website dax patterns dot com. Just look in the cumulative totals section. – Pieter May 18 '23 at 15:57

0 Answers0