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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Current row column value

Hi !

I'm creating a calculated column. For each calculated row of the column, I need the value of another column of the table, on the same row.

I called this value _weight and I calculated like this :

VAR _weight = CALCULATE(ShipDetails[NET_WEIGHT_LBS])
I thought this would work since the CALCULATE function generates a row context (?) but an error message is shown, saying that it cannot find a unique value for the ShipDetails[NET_WEIGHT_LBS] column.
I feel like this should be very easy but I don't know why it doesn't work or what I should do.
Please help me !
Thank you.
1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

You can just use

 

var _weight = ShipDetails[NET_WEIGHT_LBS]

 

 

You can have a look at this video to understand more on Context Transition.

https://www.youtube.com/watch?v=03E0f-RyRn4

 

Regards,

Harsh Nathani

View solution in original post

3 REPLIES 3
Pragati11
Super User
Super User

Hi @Anonymous ,

 

You have to use an aggregation function in your DAX like SUM, AVERAGE, etc.

Something like this:

VAR _weight = CALCULATE(SUM(ShipDetails[NET_WEIGHT_LBS]))

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

You can just use

 

var _weight = ShipDetails[NET_WEIGHT_LBS]

 

 

You can have a look at this video to understand more on Context Transition.

https://www.youtube.com/watch?v=03E0f-RyRn4

 

Regards,

Harsh Nathani

Anonymous
Not applicable

Thank you very much @harshnathani !

 

Regards,

Marion

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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