This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello,
I need help about the following behavior. I built a toy model to explicit the problem.
CalGroup is a calculation group with 2 calculation items:
to2: SELECTEDMEASURE()*2
to3: SELECTEDMEASURE()*3
Data is a simple table:
DATATABLE("Col", STRING, {{"A"},{"B"}})to which I added the following measures:
BaseMeasure = IF(SELECTEDVALUE(Data[Col]) == "A", 1, 2)
To2Measure = CONVERT(CALCULATE([BaseMeasure], CalGroup[Name] == "to2"), INTEGER)
To3Measure = CONVERT(CALCULATE([BaseMeasure], CalGroup[Name] == "to3"), INTEGER)
and I added the following calculated column to Data:
Col-BaseMeasure = CALCULATE([BaseMeasure])
Col-To2-Dir = CONVERT(CALCULATE([BaseMeasure], CalGroup[Name] == "to2"), INTEGER)
Col-To3-Dir = CONVERT(CALCULATE([BaseMeasure], CalGroup[Name] == "to3"), INTEGER)
Col-To2-Ind = CONVERT(CALCULATE([To2Measure]), INTEGER)
Col-To3-Ind = CONVERT(CALCULATE([To3Measure]), INTEGER)
When I run the following query:
EVALUATE 'Data'
It yields:
| Col | Col-BaseMeasure | Col-To2-Dir | Col-To3-Dir | Col-To2-Ind | Col-To3-Ind |
| A | 1 | 2 | 3 | 1 | 1 |
| B | 2 | 4 | 6 | 2 | 2 |
The calculation group is not honored in indirect measure, but if I run:
EVALUATE
SUMMARIZE(Data, Data[Col]
, "BaseMeasure", CALCULATE([BaseMeasure])
, "Col-To2-Dir", CONVERT(CALCULATE([BaseMeasure], CalGroup[Name] == "to2"), INTEGER)
, "Col-To3-Dir", CONVERT(CALCULATE([BaseMeasure], CalGroup[Name] == "to3"), INTEGER)
, "Col-To2-Ind", CONVERT(CALCULATE([To2Measure]), INTEGER)
, "Col-To3-Ind", CONVERT(CALCULATE([To3Measure]), INTEGER)
)
I get the correct result.
What do I miss ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.