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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ASchulz
New Member

How to Create a column that references another column value and NOT the data table

I have a table that I am having difficulty with. In the below table, my Locations and Plt Cap columns are not summing up because I had to use the Minimum calculation to get the value I want in the rows.

ASchulz_0-1702496098119.png

 

The code that I used for locations is this: 

LocationsForProductTypeTable = If([Product Type] = "NON-HAZ (Mezz)", 13, If([Product Type] = "NON-HAZ (A's)", 300, If([Product Type] = "Haz", 220, If([Product Type] = "Candle",5, 1))))
 
The problem is that all I want is in THIS SPECIFIC TABLE, if the Product Type is Candle, I want THIS SPECIFIC COLUMN on this table to show the value of 5. Is this something possible that I can do in Power BI?
1 ACCEPTED SOLUTION
ASchulz
New Member

The solution to this lied within adding this code as a seperate measure

SumOfMaxLocations =
SUMX(
    SUMMARIZE(
        Query1, [Product Type],[LocationsForProductTypeTable]
    ),[LocationsForProductTypeTable])

View solution in original post

2 REPLIES 2
ASchulz
New Member

The solution to this lied within adding this code as a seperate measure

SumOfMaxLocations =
SUMX(
    SUMMARIZE(
        Query1, [Product Type],[LocationsForProductTypeTable]
    ),[LocationsForProductTypeTable])
Martin_D
Super User
Super User

Assuming [Product Type] is a column of table MyTable, then the following measure would do the job:

Locations = IF(SELECTEDVALUE(MyTable[Product Type])="Candle",5)

Then add the measure to your visual.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.