Forum Discussion

anix's avatar
anix
Regular Visitor
3 years ago
Solved

calculate value between tables

Hi Guys

 

Hope you can help me out with this one since i think it is quite a essential feature to be able to calculate. I can solve it in excel but it takes a fair share of time and files get pretty heavy.

I have some sku's with different colours ex. 192 SKU's with the colours STD.

I will like to know how big a % NO in table two is buying of the total number of SKUS with the colours STD and display it in table two.

So 75/195 in % next to the 75.

 

Thanks for your support!

 

 

  • Hi anix ,

     

    Based on your description, I have created a simple sample:

    Please try:

    Percentage = 
    var _a = SUM('Table'[SKU])
    var _b = CALCULATE(SUM('Table'[SKU]),FILTER(ALL('Table'),[Colour]=SELECTEDVALUE('Table'[Colour])))
    return DIVIDE(_a,_b)

    Final output:

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • Hi anix ,

     

    Based on your description, I have created a simple sample:

    Please try:

    Percentage = 
    var _a = SUM('Table'[SKU])
    var _b = CALCULATE(SUM('Table'[SKU]),FILTER(ALL('Table'),[Colour]=SELECTEDVALUE('Table'[Colour])))
    return DIVIDE(_a,_b)

    Final output:

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.