Forum Discussion

andreaturri27's avatar
6 years ago
Solved

total column calculation measure

Hi Community, 

 

i have a problem with calculation total on this measure.

 

 

 

 

 

0-6mesi =

IF([Ageing mese]>=0 &&[Ageing mese]<=6;
IF( ISFILTERED(MA_ItemsFiscalData[Item]);[Costo Medio FIX totale];[Costo Medio FIX totale]))
But the total correct is 1.790,8‬ can i fix it?

I use this formulas 

Ageing mese (Measure)= (DATEDIFF([Data ultimo movimento];[Data ultimo acquisto];MONTH))+ DATEDIFF([Data ultimo acquisto];"27/03/2020";MONTH)

Data ultimo acquisto (Measure)=
MAXX(FILTER(MA_InventoryEntriesDetail;MA_InventoryEntriesDetail[Item]=MA_InventoryEntriesDetail[Item] && RELATED(MA_InventoryEntries[InvRsn]) in {"ACQ-O";"ACQ"});MA_InventoryEntriesDetail[PostingDate].[Date])
Data ultimo movimento (Measure) =
MAXX(FILTER(MA_InventoryEntriesDetail;MA_InventoryEntriesDetail[Item]=MA_InventoryEntriesDetail[Item] && RELATED(MA_InventoryEntries[InvRsn]) in {"VEN-O";"VEND";"VEN";"VENPREL";"VENPICK";"VENPICKM";"CARICO";"SCARICO";"CARICOM";"SCARICOM"});MA_InventoryEntriesDetail[PostingDate].[Date])
Costo Medio FIX totale (Measure)= SUMX(SUMMARIZE(MA_ItemsFiscalData;MA_ItemsFiscalData[Item];"pippo";[Costo medio]);[pippo])
Costo medio (Measure)=
(MAXX(FILTER(MA_ItemsFiscalData;MA_ItemsFiscalData[Item]=MA_ItemsFiscalData[Item] && MA_ItemsFiscalData[FiscalYear]=year("27/03/2020"));MA_ItemsFiscalData[BookInvValue]))
 
 
 
 
 
  • For Grand total you need to correct row context. Try Like

    sumx(summarize(Table, Table[Cort Art], "_0_6mesi",[0-6mesi]),[_0_6mesi])

     

    Add group by as per need.

     

     

2 Replies

  • For Grand total you need to correct row context. Try Like

    sumx(summarize(Table, Table[Cort Art], "_0_6mesi",[0-6mesi]),[_0_6mesi])

     

    Add group by as per need.

     

     

  • v-gizhi-msft's avatar
    v-gizhi-msft
    Icon for Community Support rankCommunity Support

    Hi,

     

    Please try measure like this:

    0-6mesi =
    SUMX (
        GROUPBY (
            'Table';
            'Table'[Cod Art];
            'Table'[Desc Cat merc];
            'Table'[Desc Cat Omo]
        );
        IF (
            [Ageing mese] >= 0
                && [Ageing mese] <= 6;
            IF (
                ISFILTERED ( MA_ItemsFiscalData[Item] );
                [Costo Medio FIX totale];
                [Costo Medio FIX totale]
            )
        )
    )

    Remember to replace the 'table' with your table name.

    Hope this helps.

    If you still have any issue, please share some sample data(original data excluding measures) and tables' relationships(linked columns) as a screenshot.

    Expect your reply!

     

    Best Regards,

    Giotto Zhi