cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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

 

v-tangjie-msft
Community Support
Community Support

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors