Forum Discussion
Setup alternate names for Calculation items in a Calculation Group
- 2 years ago
Hi VickyDev18
(Disclosure: The blog posts linked below are my own.)
Yes 🙂 This post covers these types of situations:
https://owenaugerbi.com/creating-alias-columns-for-calculation-groups/
The main constraint is that columns can only be added to a calculation group table as DAX calculated columns. Also, calculation group tables cannot have relationships with other tables.
1. For alternative names, using your example, you could create a calculated columns such as this (assuming the original calculation item column is 'Time Intelligence'[Time Calc]:
Time Calc Alternative = SWITCH ( 'Time Intelligence'[Time Calc], "MTD", "Month-To-Date", "QTD", "Quarter-To-Date", "YTD", "Year-To-Date", 'Time Intelligence'[Time Calc] -- use original name as default )For this to work correctly, you must then set the Group By Columns property of the new column to be the original calculation item column using Tabular Editor (see the post linked above), as well as setting the Sort By Column if desired.
There is an alternative method covered in this blog post as well.
2. For grouping or filtering columns, you also have to add calculated columns using appropriate DAX expressions.
You could use expressions that reference another table if you like (such as a hidden lookup table), but the calculation group table cannot have relationships with other tables.
A simple example of a grouping/filtering column might be:
Time Calc Group = IF ( CONTAINSSTRING ( 'Time Intelligence'[Time Calc], "%" ), "Percentage", "Amount" )Hopefully this helps. Please post back if needed 🙂
Regards
Hi VickyDev18
(Disclosure: The blog posts linked below are my own.)
Yes 🙂 This post covers these types of situations:
https://owenaugerbi.com/creating-alias-columns-for-calculation-groups/
The main constraint is that columns can only be added to a calculation group table as DAX calculated columns. Also, calculation group tables cannot have relationships with other tables.
1. For alternative names, using your example, you could create a calculated columns such as this (assuming the original calculation item column is 'Time Intelligence'[Time Calc]:
Time Calc Alternative =
SWITCH (
'Time Intelligence'[Time Calc],
"MTD", "Month-To-Date",
"QTD", "Quarter-To-Date",
"YTD", "Year-To-Date",
'Time Intelligence'[Time Calc] -- use original name as default
)
For this to work correctly, you must then set the Group By Columns property of the new column to be the original calculation item column using Tabular Editor (see the post linked above), as well as setting the Sort By Column if desired.
There is an alternative method covered in this blog post as well.
2. For grouping or filtering columns, you also have to add calculated columns using appropriate DAX expressions.
You could use expressions that reference another table if you like (such as a hidden lookup table), but the calculation group table cannot have relationships with other tables.
A simple example of a grouping/filtering column might be:
Time Calc Group =
IF (
CONTAINSSTRING ( 'Time Intelligence'[Time Calc], "%" ),
"Percentage",
"Amount"
)
Hopefully this helps. Please post back if needed 🙂
Regards
- VickyDev182 years ago
Advocate II
Thanks OwenAuger for the detailed response. I think i'll skip the aliasing part given the additional settings required to make it work but grouping seems easy enough through either calculated column approach or lookup.
Thanks for all the details. Learnt quite a few new things.