Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.