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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
fabiojoa
Helper I
Helper I

Cumulative Formula not Working

Hello DaxLovers friends!

I need to make a cumulative sum and I am using a ranking to assist in this task. I need to show in a table the Product Reference, Product Description, Sales Value,% of Total, Ranking and I need to put the Accumulated in order to create the ABCD Chart.

 

First, we create total sales for the period:

MTD-VPR-Vendas (Ano) =
    CALCULATE(
        SUMX(FAT_VENDAPRODUTO; FAT_VENDAPRODUTO[VPR_VALOR]);
        FILTER('DIM_TEMPO'; 'DIM_TEMPO'[Date] >= [MTD-FIL-#varMinDateAno]
                         && 'DIM_TEMPO'[Date] <= [MTD-FIL-#varMaxDateAno]
    ))
 
Then I ranked ABCD and it seems to work well!
ABC_RANK =
If ( [MTD-VPR-Vendas (Ano)]>0;
CALCULATE(
RANKX(ALL(DIM_PRODUTO[PRD_REFERENCIA];DIM_PRODUTO[PRD_DESCRICAO]);[MTD-VPR-Vendas (Ano)];;DESC;Skip);
ALLSELECTED(DIM_LOJA_META);ALLSELECTED(DIM_FIL_TEMPO)
))
 
But, my accumulated total doesn't work at all. I tried two different formulas and said I was frustrated
that I couldn't do something that I thought would be easier.
ABC_VENDAS_ACUMULADAS =
Var RankAtual = [ABC_RANK]
Return
If(
 [MTD-VPR-Vendas (Ano)]>0;
 Calculate(
  [MTD-VPR-Vendas (Ano)];
  Filter(
   ALL(DIM_PRODUTO[PRD_REFERENCIA]); [ABC_Rank]<=RankAtual
   )
 )
)
 
Could someone help me with this challenge that is driving me crazy?
 
0 REPLIES 0

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors