This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi - My sample data looks like the following:
| Sales | Internal/ External | Category | Flag |
| 10 | Internal | Cat1 | Flag 1 |
| 20 | External | Cat1 | Flag 1 |
| 30 | Internal | Cat2 | Flag 1 |
| 40 | External | Cat2 | Flag 1 |
| 50 | Internal | Cat1 | Flag 2 |
| 60 | External | Cat1 | Flag 2 |
| 70 | Internal | Cat2 | Flag 2 |
| 80 | External | Cat2 | Flag 2 |
I want to create a combined table like below based on the following two sub tables:
| Category | Flag 1 | Flag 2 | ||
| Internal | External | Internal | External | |
| Cat1 | 10 | 20 | 50 | 60 |
| Cat2 | 30 | 40 | 70 | 80 |
| Category | Total no. of sales | |
| Internal | External | |
| Cat1 | 60 | 80 |
| Cat2 | 100 | 120 |
Final output table needed:
| Category | Total no. of sales | Flag 1 | Flag 2 | |||
| Internal | External | Internal | External | Internal | External | |
| Cat1 | 60 | 80 | 10 | 20 | 50 | 60 |
| Cat2 | 100 | 120 | 30 | 40 | 70 | 80 |
Solved! Go to Solution.
Hi @Marico ,
The following virtual table can be created with the help of the NATURALINNERJOIN function:
FlagTable =
SUMMARIZE(
'SalesData',
'SalesData'[Category],
'SalesData'[Flag],
'SalesData'[Internal/ External],
"SalesAmount", SUM('SalesData'[Sales])
)
TotalSalesTable =
SUMMARIZE(
'SalesData',
'SalesData'[Category],
'SalesData'[Internal/ External],
"TotalSales", SUM('SalesData'[Sales])
)
FinalOutputTable =
NATURALINNERJOIN(
SUMMARIZE(
'SalesData',
'SalesData'[Category],
'SalesData'[Internal/ External],
"TotalSales", SUM('SalesData'[Sales])
),
SUMMARIZE(
'SalesData',
'SalesData'[Category],
'SalesData'[Flag],
'SalesData'[Internal/ External],
"FlagSales", SUM('SalesData'[Sales])
)
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Marico ,
The following virtual table can be created with the help of the NATURALINNERJOIN function:
FlagTable =
SUMMARIZE(
'SalesData',
'SalesData'[Category],
'SalesData'[Flag],
'SalesData'[Internal/ External],
"SalesAmount", SUM('SalesData'[Sales])
)
TotalSalesTable =
SUMMARIZE(
'SalesData',
'SalesData'[Category],
'SalesData'[Internal/ External],
"TotalSales", SUM('SalesData'[Sales])
)
FinalOutputTable =
NATURALINNERJOIN(
SUMMARIZE(
'SalesData',
'SalesData'[Category],
'SalesData'[Internal/ External],
"TotalSales", SUM('SalesData'[Sales])
),
SUMMARIZE(
'SalesData',
'SalesData'[Category],
'SalesData'[Flag],
'SalesData'[Internal/ External],
"FlagSales", SUM('SalesData'[Sales])
)
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Your data tables has not been pasted properly in your original post - only the first one is clear.
Hi @dharmendars007 - Sorry, I am new to Power BI, all these calculations so would be created through a "New Table measure"? Alos, can't we directly create the final table using summarize?
Hello @Marico ,
Step1 -You will need to calculate the total sales grouped by Category and Internal/ExternaL.
Step 2 - Create a Masure for both Flag1 and Flag2
Step3 = Create a final Table using summarize then use the same to plot in the table visual like you wish in output
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!
Thank You
Dharmendar S
@dharmendars007 I am not able to create the matrix like the below from output of summarize table:
Could you please share a sample file? Thanks a lot in advance.
@lbendlin @Greg_Deckler @Ritaf1983 @rajendraongole1 @parry2k Any thoughts on above?
Your desired output doesn't seem to make sense. What would you change on the below (which was done without coding)
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 25 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 61 | |
| 49 | |
| 28 | |
| 23 | |
| 23 |