Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Subtraction for Group BY (Unique UID)

Hi Team,

 

I need your help for below calulation part,

Expected Result : a_Remaining Stock 
formula : (UID in Stock - a_Prod_Total ) 
note : UID in Stock and a_Prod_Total both are calculated in new Measure 

 

Thanks,

KV's

  • Anonymous , The input table and ask is not matching.

     

    But if you want an action on grouped data, these are the ways.

     

    sumx(values(Table[UID]),[UID in Stock] -[a_Prod_Total])
    sumx(summarize(Table,Table[UID],"_1",[UID in Stock] -[a_Prod_Total]),[_1])

     

    If this does not help

    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

2 Replies

  • AllisonKennedy's avatar
    AllisonKennedy
    Community Champion

    Anonymous  Please can you provide more information on what you want to do and what currently doesn't work/where you're stuck? 

     

    You should be able to do this using a table visual and simply using the measures you already have, just remove all the other columns from the table so only UID and the measures are in the table - this will automatically group by that column for you.

  • Anonymous , The input table and ask is not matching.

     

    But if you want an action on grouped data, these are the ways.

     

    sumx(values(Table[UID]),[UID in Stock] -[a_Prod_Total])
    sumx(summarize(Table,Table[UID],"_1",[UID in Stock] -[a_Prod_Total]),[_1])

     

    If this does not help

    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.