Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PKPK90
Helper I
Helper I

Totals from SummarizeColumns

Hi, I have created new table 

SupplyDemandPerSiteItem =
SUMMARIZECOLUMNS(
    DistinctTable[Site],
    DistinctTable[ItemKey],
    "Demand",MAX(DistinctTable[RunningRequirement]),
    "Supply",MAX(DistinctTable[RunningReception]))
 
from this table I want to get
SupplyDemandPerItem=
SUMMARIZECOLUMNS(
   SupplyDemand[ItemKey],
  "Demand",SUM(Demand),
  "Supply",SUM(Supply))
 
Is it possible to to achieve the same result but in the first table?
I don't want to create two tables if it's not necessary.
4 REPLIES 4
Anil_kapkoti
New Member

Check this one
SupplyDemandPerItem =
VAR DemandTable =
SUMMARIZE(
DistinctTable,
DistinctTable[Site],
DistinctTable[ItemKey],
"Demand", MAX(DistinctTable[RunningRequirement])
)
VAR SupplyTable =
SUMMARIZE(
DistinctTable,
DistinctTable[Site],
DistinctTable[ItemKey],
"Supply", MAX(DistinctTable[RunningReception])
)
RETURN
SUMMARIZECOLUMNS(
DistinctTable[ItemKey],
"Demand", SUMX(DemandTable, [Demand]),
"Supply", SUMX(SupplyTable, [Supply])
)

Hi, I am receiving the same values for every Item.

PKPK90_0-1691484065489.png

 

Anonymous
Not applicable

Hi @PKPK90 ,

 

Please try:

SupplyDemandPerItem =
SUMMARIZECOLUMNS(
    DistinctTable[ItemKey],
    "Demand", SUMX(SUMMARIZECOLUMNS(
        DistinctTable[Site],
        DistinctTable[ItemKey],
        "Demand", MAX(DistinctTable[RunningRequirement])
    ), [Demand]),
    "Supply", SUMX(SUMMARIZECOLUMNS(
        DistinctTable[Site],
        DistinctTable[ItemKey],
        "Supply", MAX(DistinctTable[RunningReception])
    ), [Supply])
)

 

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. 

Thanks, I am receiving error message like:

SummarizeColumns() and AddMissingItems() may not be used in this context.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.