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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
setis
Post Partisan
Post Partisan

SUMX in table

Dear experts,

 

I need to multiply a measure by another measure in a table. 

 

One of the measures needs a particular column structure to give the intended result 

 

I have a matrix in with I've switched columns and rows and my rows are:
Calendar Year, Calendar Month, Week, Week Day.

rowns matrix.PNG

 

The measure works and I need to multiply this measure "Forecast" on a row-by-row by another measure "Agregate Factor" 

 

My firs attempt was a simple SUMX:

testAgregate = 
SUMX(VALUES('Date'[Date]); [Forecast allocated2] * [Agregate Factor])

but this is giving me wrong results:

error3.PNG

 

Then I tried using summarizecolumns:

 

testAgregate = 
SUMMARIZECOLUMNS(
    'Date'[Calendar Year];
    'Date'[Calendar Month];
    'Date'[Calendar Week];
    'Date'[Week Day];
    'Date'[Date];
    "Test Agregate" ; SUMX(VALUES('Date'[Date]); [Forecast allocated2] * [Agregate Factor])
)

But I'm getting the error "The expresion refers to multiple columns. Multiple columns cannot be converted to a scalar value"

 

 

 

What am I doing wrong?

 

 

 

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @setis ,

 

we can create measure using following DAX to meet your requirement.

 

 

testAgregate = SUM(Data[Forecast allocated2]) * SUM(Data[Agregate Factor])

 

 

SUMX-IN-Table-1.PNG

 

If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-lid-msft
Community Support
Community Support

Hi @setis ,

 

we can create measure using following DAX to meet your requirement.

 

 

testAgregate = SUM(Data[Forecast allocated2]) * SUM(Data[Agregate Factor])

 

 

SUMX-IN-Table-1.PNG

 

If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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