Forum Discussion
Understanding column in DAX function
- 4 years ago
Hi,
A calculated column in DAX, is a calculation made row by row within your table and using the Row context of your table (granularity of one row). Knowing this, it is useless (in a calculated column) to specify the value you are using in the calculation, it will be the value of the current calculated row.
(In theory because using DAX functions you can change the context, but that is another thing).
Whereas when you create a measure there is no calculation made, it will be made directly as you put your measure in a visual (table or chart). So the result will rely on the visual, if you make a table with year you have yearly results, if you make a table with catagory you have results by categories , or by month, project name...
So when you create a measure, as the measure might have to agregate some values (rows), you need to specify how this agregation will be processed (SUM, MAX, MIN, SELECTEDVALUE for the value on the row of your visual...).
Another way of saying it would be, that measure are taking into account the whole column so you need to specify which value you want in the column.
Hope it makes things more clear, and for the formula thanks to tamerj1 🙂
Hi,
A calculated column in DAX, is a calculation made row by row within your table and using the Row context of your table (granularity of one row). Knowing this, it is useless (in a calculated column) to specify the value you are using in the calculation, it will be the value of the current calculated row.
(In theory because using DAX functions you can change the context, but that is another thing).
Whereas when you create a measure there is no calculation made, it will be made directly as you put your measure in a visual (table or chart). So the result will rely on the visual, if you make a table with year you have yearly results, if you make a table with catagory you have results by categories , or by month, project name...
So when you create a measure, as the measure might have to agregate some values (rows), you need to specify how this agregation will be processed (SUM, MAX, MIN, SELECTEDVALUE for the value on the row of your visual...).
Another way of saying it would be, that measure are taking into account the whole column so you need to specify which value you want in the column.
Hope it makes things more clear, and for the formula thanks to tamerj1 🙂
- beltalowda4 years agoRegular Visitor
Hi,
Thanks all for your replies.
This post have made me think alot on how I structure my reports, and I believe I am a little bit closer to understanding when to use measures and when a new coulumn is appropriate.
For the solution, the concatenatex function did give a calulateble solution, but for some edge cases it produced alot of duplicates. I did not spend to much time understanding why that happen and just went ahead and made a new coulumn with :ProjectShortColoumn = MID( Project[project_name],FIND("-",Project[project_name], FIND("/",Project[project_name], ,1) ,1)+1 ,5)This is working flawlessly, so I understand now that there is no point in making a more complex calculation when a simple coloumn will be sufficent!
Thank you for all your insight !