Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am new to Direct Query on data. I would like to create a measure for an item within a folder of the table.
Table format:
Case Table
Item One
Item Two
Folder One
Folder One Item One
Folder One Item Two
The measure that I am trying to create.
ItemLen = len('Case Table'[Folder One Item Two])
This does not work. I tried this next.
ItemLen = len('Case Table''Folder One'[Folder One Item Two])
This does not work.
ItemLen = len('Case Table','Folder One',[Folder One Item Two])
This does not work.
ItemLen = len('Case Table'.'Folder One'.[Folder One Item Two])
This does not work.
I need help with writing this measure. Thank you.
Solved! Go to Solution.
HI @STIBBS_807 ,
Folder is just a display view within your CASES table.
I think the problem here is the DAX function that you are using.
LEN function returns the length of a text value. Here you are trying to apply it directly on a column which is wrong. This LEN function works on a single text value.
You can read more details about this function here:
https://learn.microsoft.com/en-us/dax/len-function-dax
If you want to use this function on a column, you will have to use an agrregation on your column before applying LEN dax function to it.
Something like this below:
test = LEN(MAX('Countries emissions'[CO2 Emission Type]))
Hope this helps.
Hi @STIBBS_807 ,
I don't understand th format of your tables. Can you elaborate more?
What do you mean by "measure for an item within a folder of the table"?
Here is the table and the folder I am trying to get to:
I want to get the length of the Case Owner Team item to figure out where to truncate the first four characters off the word.
So my formula is: right(Case Owner Team, (len(Case Owner Team)-4))
Here is the Data folder in Power BI. See the folder in the list.
HI @STIBBS_807 ,
Folder is just a display view within your CASES table.
I think the problem here is the DAX function that you are using.
LEN function returns the length of a text value. Here you are trying to apply it directly on a column which is wrong. This LEN function works on a single text value.
You can read more details about this function here:
https://learn.microsoft.com/en-us/dax/len-function-dax
If you want to use this function on a column, you will have to use an agrregation on your column before applying LEN dax function to it.
Something like this below:
test = LEN(MAX('Countries emissions'[CO2 Emission Type]))
Hope this helps.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
50 | |
45 | |
38 | |
38 |