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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

do calculation on rowlevel and aggregate on summirized level

Hi, 

 

I have a calculation on Item level and I want to sum the result when more then one item is selected

 

"simple" example below:

 

 avg priceavg price LYVolumeVolume LYsales Sales LYSales this year's price LY's volume
item 110850004500500003600045000
item 23025500030015000075009000
item 3181850004800900008640086400
total19,3317150009600290000129900185600

 

I am looking for a dax code to "Sales this year's price LY's volume". 

Currently it is 

Sales this year's price LY's volume = [avg price] * [Volume LY]

It is correct on row level. On the total row I would like it to show the sum (140400) instead of 185600 (red in table). 

the source table contains sales on order level so adding a calculated column would mean I would first have to create a new consolidated table and that a lot of details currently available would be lost. 

 

any advice?

 

BR

G

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I got it to work with 

sumx( values( Sales[ItemID]), [avg price] * [Volume LY] )

 

 

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

I got it to work with 

sumx( values( Sales[ItemID]), [avg price] * [Volume LY] )

 

 

 

Anonymous
Not applicable

... I am running in direct querry. That is why it does not work. 

 

/G

Anonymous
Not applicable

Thanks again. 

 

I am getting a error:

"Failed to resolve name 'ISINSCOPE'. It si not a valid table, variable, or function name." 

I am sure I did not misspell...

 

any ideas? 

/g

 

johnt75
Super User
Super User

You can try

Sales this years price LY volume = SUMX( 'Products', [avg price] * [Volume LY])
Anonymous
Not applicable

Hi, 

 

I tried but it gives me the sum of all items (30 000+) not just the three selected. 

 

/g

 

Try

Sales this years price LY volume =
IF (
    ISINSCOPE ( 'Products'[item code] ),
    SUMX ( 'Products', [avg price] * [Volume LY] ),
    CALCULATE (
        SUMX ( 'Products', [avg price] * [Volume LY] ),
        ALLSELECTED ( 'Products' )
    )
)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.