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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Setosa
Advocate I
Advocate I

Addcolumn and vlookup

I just created a new calculated column (FY24_AOP_Rate) into the factable. I would like to simply multiple and sum the result. but the code below seems is not responding the calculation. what i am doing it wrong ? many thanks in advance.

FY24_AOP_Rate =
LOOKUPVALUE(
            _SlicerTable[FY24 AOP],
            _SlicerTable[Currency], 'facttable'[Currency])

_SumXAmount =
SUMX (
     FILTER('facttable', 'facttable'[COL] = "A"),
    'facttable'[Amount]*('facttable'[FY24_AOP_Rate]))
1 ACCEPTED SOLUTION
v-zhouwen-msft
Community Support
Community Support

Hi @Setosa ,

I've assumed some data:
Facttable:

vzhouwenmsft_0-1709009655865.png

_SlicerTable:

vzhouwenmsft_1-1709009672991.png

1.Using the dax expression you provided I created the calculated column ‘FY24_AOP_Rate’

vzhouwenmsft_2-1709009708013.png

 

2.Using the dax expression you provided I created the measure ‘_SumxAmount’, The function successfully computed the data I assumed.

vzhouwenmsft_3-1709009733943.png

 

 

Make sure the correct columns are applied in the lookupvalue function, there should be a many-to-one relationship between the fact sheet and the dimension sheet. If there are multiple rows of data that satisfy the filter criteria, the lookupvalue function will only return the first row of data that matches, which can make the result of the calculation wrong.

 

 


Best Regards,
Wenbin Zhou
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

2 REPLIES 2
v-zhouwen-msft
Community Support
Community Support

Hi @Setosa ,

I've assumed some data:
Facttable:

vzhouwenmsft_0-1709009655865.png

_SlicerTable:

vzhouwenmsft_1-1709009672991.png

1.Using the dax expression you provided I created the calculated column ‘FY24_AOP_Rate’

vzhouwenmsft_2-1709009708013.png

 

2.Using the dax expression you provided I created the measure ‘_SumxAmount’, The function successfully computed the data I assumed.

vzhouwenmsft_3-1709009733943.png

 

 

Make sure the correct columns are applied in the lookupvalue function, there should be a many-to-one relationship between the fact sheet and the dimension sheet. If there are multiple rows of data that satisfy the filter criteria, the lookupvalue function will only return the first row of data that matches, which can make the result of the calculation wrong.

 

 


Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

you cannot/should not create calculated columns from filters/slicers/measures. Instead, let the data model do its job.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.