Forum Discussion
jhendrickson
8 years agoRegular Visitor
Create a Calculated Column from Different Tables
I am attempting to add a column to a table in the Query Editor, using a column from a related table. I am getting an error "Token literal expected." The relationship between these tables has been set...
- 8 years agoSorry that's my bad. I happen to work on a French system and it is using ";" rather than comma ",".
You need to replace all ";" by the proper separator which should be comma for you.
jhendrickson
8 years agoRegular Visitor
https://www.dropbox.com/l/scl/AAC88asXaxFoogfp3MGpSW2R6A-TPrTFxAU
This is a very truncated version of my data - thank you everyone for your help!
SuperSayan
8 years agoResolver I
I was able to recover the number of pupil in a new column in your "Sheet1" table if that is what you were looking after.
However, the dataset seems very complicated for me, especially the management of the dates.
PowerBI works magic with dates so it would be better to have full dates using PowerBI Date functions rather that several columns with period, month names etc. just a thought.
I created this column with the below DAX function:
Pupil number =
var y=RELATED('Year'[Year])
var sc=RELATED(Schools[School])
var pupilnumber=CALCULATE(max('Pupil transposed (2)'[pupils]);'Pupil transposed (2)'[school]=sc;'Pupil transposed (2)'[year ]=y)
return pupilnumber
Is the below what you are looking for?
- jhendrickson8 years agoRegular Visitor
Yes, that is what I want, but when I attempted this in my actual data set, I get this error:
- SuperSayan8 years agoResolver ISorry that's my bad. I happen to work on a French system and it is using ";" rather than comma ",".
You need to replace all ";" by the proper separator which should be comma for you.- jhendrickson8 years agoRegular Visitor
Hallelujah! Thank you!