Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello
I'm trying to create a new table based on values in a different table. I have already created working relations between the tables.
What I have tried to do in DAX is this, first create new table then new column:
New Column= IF('Ledning'[Statuskode]=6;'Delledning'[OpstroemsNavn]&" - "&'Delledning'[NedstroemsNavn]&", "&"Ø"&'Delledning'[Handelsmaal]&", "&'K_LedningMateriale'[Ledningsmateriale_Beskrivelse])
Which if the condition was true I would like to a return af string looking like this without quotations: "155161S - 155131S, Ø200, PVC"
But I keep getting a error A single value for column 'Statuskode' in table 'Ledning' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
Solved! Go to Solution.
Hi, @FoolzRailer
The judgment basis in your if statement must come from the same table, so you cannot use 'Ledning'[Statuskode]=6 as the condition. You need to create a corresponding calculated column in the Delledning table as the condition.
Take a try formula as below:
Calculated column in Table"Delledbing":
Statuskode =related('Ledning'[Statuskode])
Measure:
New Column= IF('Delledning'[Statuskode]=6,'Delledning'[OpstroemsNavn]&" - "&'Delledning'[NedstroemsNavn]&", "&"Ø"&'Delledning'[Handelsmaal]&", "&'K_LedningMateriale'[Ledningsmateriale_Beskrivelse])
If it doens't meet your requirement,please how the table structure and the relationship between current two tables. It will be better if you can share a sample pbix file for tesing.
Best Regards,
Community Support Team _ Eason
Hi, @FoolzRailer
The judgment basis in your if statement must come from the same table, so you cannot use 'Ledning'[Statuskode]=6 as the condition. You need to create a corresponding calculated column in the Delledning table as the condition.
Take a try formula as below:
Calculated column in Table"Delledbing":
Statuskode =related('Ledning'[Statuskode])
Measure:
New Column= IF('Delledning'[Statuskode]=6,'Delledning'[OpstroemsNavn]&" - "&'Delledning'[NedstroemsNavn]&", "&"Ø"&'Delledning'[Handelsmaal]&", "&'K_LedningMateriale'[Ledningsmateriale_Beskrivelse])
If it doens't meet your requirement,please how the table structure and the relationship between current two tables. It will be better if you can share a sample pbix file for tesing.
Best Regards,
Community Support Team _ Eason
Not sure which table you are creating that column on, but ou are referencing two tables in that expression. While you have a relationship, more is needed to know which row in the other table is needed. You will need to use RELATED or RELATEDTABLE in your expression, or something like CALCULATE(MIN(Table2[ColumnName]) to trigger context transtion (to turn the context of the row you are on to a filter on the related table).
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
I'm trying to add my new calculated IF column in a new empty table i just made. So basically I have a completly empty table, where I would like to add some data from Dellednings table but only if the StatusKode in Ledningstable is 6.
Not quite sure how to work with related as I'm fairly new to this, and I don't have any data in my new table I'm trying to create. I'm sorry if this is a bad approach, I'm kinda learning by doing. I've added a picture with some sample data.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
70 | |
68 | |
50 | |
32 |
User | Count |
---|---|
117 | |
100 | |
73 | |
65 | |
40 |