Forum Discussion
Extract name calculation item from calculation group
- Anonymous5 years ago
Hi Anonymous,
As the document said, these functions are based on the calculation groups. How did you calculate group settings? Did you confirm you have correctly configured these fields and properties?
If not, you can take a look at the following blog that mentioned about create calculate groups in power bi dekstop:
Creating Calculation Groups in Power BI Desktop
Regards,
Xiaoxin Sheng
Anonymous I had the exact same issue, creating a conditionally formatted title for a visual.
Inspired by a SQLBI video one way to solve this is to:
1) Create a disconnected table, referencing your Calculation Group (in this example 'Internal Calc Group').
Disconnected table =
-- This is the disconnected table available for the user (put 'Disconnected table'[Measure] field in the slicer).
SELECTCOLUMNS(
'Internal Calc Group',
"Measure",'Internal Calc Group'[Name],
"Ordinal",'Internal Calc Group'[Ordinal]
)
2) Use a Generic measure in your visual as Values.
This Generic measure will be replaced based on the slicer selection, therefore it behaves as if a Calculation Group were applied on it ('Disconnected table'[Measure] values are treated as Calculation Items of 'Internal Calc Group'), plus - since the field in the slicer is from a regular table - its value can be captured by SELECTEDVALUE.
Generic measure :=
-- To be replaced according to your Calculation Items.
CALCULATE(
COALESCE([MeasureInYourCalcItem1],[MeasureInYourCalcItem2],[MeasureInYourCalcItem3]),
TREATAS(
VALUES('Disconnected table'[Measure]),
'Internal Calc Group'[Name]
)
)
3) Create a measure for the dynamic title.
Dynamic title := "Month overview for " & SELECTEDVALUE('Disconnected table'[Measure])