Forum Discussion

Kent1341's avatar
Kent1341
Helper I
7 years ago

Adding "missing" rows in a calculation in Power Query

Hei,

 

I have spent a lot of time on this one from time to time, but I can not find a very good example that I can use. I hope someone can help!

 

I have a table with a different total line as well as on SKU. It looks somewhat like this:

 

Total Category \ Total Marked \ week 20 \ 20 015,- \ Category

Produkt A \ Total Marked \ week 20 \ 10 000,- \ Produkt

Produkt B \ Total Marked \ week 20 \ 9 000,- \ Produkt

Total Category \ Banner 1 \ Week 20 \ 4 000,- \ Category

Produkt A \ Banner 1 \ week 20 \ 1 950,- \ Produkt

Produkt B \ Banner 1 \ week 20 \ 500,- \ Produkt

ect.

 

As you can see it's stated in each line what the line is - as a category, brand, producer, product... (I've started only "Category" and "Produkt" for simplification.)

 

The problem is that

1. the products dose not add to the total category

2. the banners dose not add to the total marked

 

There is both a banner difference and a product difference, but the missing values can be calculated. I have read about it like this one https://community.powerbi.com/t5/Desktop/adding-rows-in-power-query-and-performance-issue/m-p/339558#M151973, but it's not the same.

 

Can anyone PLEASE help! :)

 

Br Kent

 

 

 

 

1 Reply

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi Kent1341 ,

     

    I am not sure what desired result would you want, could you please share your sample data and desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

     

    Please read this post to get your answer quickly: How to Get Your Question Answered Quickly.

     

    Best Regards,

    Amy