Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello, I have a difficulty, I have a table that works as a matrix. I have the sellers in a column and the week number on the top line. Each week can have a different commission. I need to create a formula that returns the commission corresponding to each week to another table in order to calculate the commission amount for that week. Can you help me? Thanks, best regards.
Solved! Go to Solution.
Hi @silvapaulo22 ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a table and then the result is as follows.
Table 2 = DISTINCT(SELECTCOLUMNS('Table',"week1",SUM('Table'[1]),"week2",SUM('Table'[2]),"week3",SUM('Table'[3]),"week4",SUM('Table'[4]),"week5",SUM('Table'[5]),"week6",SUM('Table'[6]),"week7",SUM('Table'[7]),"week8",SUM('Table'[8])))
(3)Or you can click "transform data" to enter the Power Query editor and pivot the columns to change the source data, and then we can create a table.
Table 3 = DISTINCT( SELECTCOLUMNS('Table (2)',"Week",'Table (2)'[Week],"Commission",CALCULATE(SUM('Table (2)'[Commission]),FILTER('Table (2)','Table (2)'[Week]=EARLIER('Table (2)'[Week])))))
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @silvapaulo22 ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a table and then the result is as follows.
Table 2 = DISTINCT(SELECTCOLUMNS('Table',"week1",SUM('Table'[1]),"week2",SUM('Table'[2]),"week3",SUM('Table'[3]),"week4",SUM('Table'[4]),"week5",SUM('Table'[5]),"week6",SUM('Table'[6]),"week7",SUM('Table'[7]),"week8",SUM('Table'[8])))
(3)Or you can click "transform data" to enter the Power Query editor and pivot the columns to change the source data, and then we can create a table.
Table 3 = DISTINCT( SELECTCOLUMNS('Table (2)',"Week",'Table (2)'[Week],"Commission",CALCULATE(SUM('Table (2)'[Commission]),FILTER('Table (2)','Table (2)'[Week]=EARLIER('Table (2)'[Week])))))
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I think you have to modify your source table with unpivot:
If you need further help, pleace post some sample data from the source table
Proud to be a Super User!
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |