Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Mere existence of a Calculation Group causes Smart Narrative with Measure to stop working

There appears to be a bug with using Measures in Smart Narratives and the mere existence of a calculation group.

 

See PBIX file.

 

There are two calculation items in the Sales Doubler calc group, one is SELECTEDMEASURE() and the other is SELECTEDMEASURE() * 2. 

The calculation group is not applied in this mode. It just exists. If I change the Sales Doubler item to just SELECTEDMEASURE() as well, the smart narrative works, but if it is anything except SELECTEDMEASURE() it returns blank, even though the card works. 

I know that by applying the CG will cause an error because you cannot multiply text * 2, but that isn't the issue. I can control that with ISSELECTEDMEASURE() or by using the CG in a slicer then editing the interactions to exclude the card and Smart Narrative, but I cannot even get that far. Doing that does not restore the smart narrative. 

This seems to be a relatively new issue. I do not recall seeing this in the past few months, and I make extensive use of measures in Smart Narratives to return the text I want.

 

edhans_0-1631546526533.png

 

Status: New
Comments
edhans
Super User

I do not think this is 100% the same thing, but am linking back to this issue as I believe it to be related. Smart Narrative & Calculation Groups incompatibili... - Microsoft Power BI Community

edhans
Super User

So a bit more info. A CG with items like this have no apparent affect on Smart Narratives:

CALCULATE(
    SELECTEDMEASURE(),
    'financials'[Year] = 2015
)


but both of these do. The first is just multiplying the measure by 2. The second is counting selected calculation groups of another calculation group - so I can return that in a chart title for example.

SELECTEDMEASURE() * 2


CALCULATE(
   COUNTROWS(VALUES('CG Counter'[Name])),
   ALLSELECTED()
)

 It seems the first one (*2) is trying to convert the string to a variant, then muliplying by 2, which is blank I guess.

No clue why the second one causes this.

And no idea why only the Smart Narrative cannot handle the variant data type. If not a bug, then a severe oversight in design.

v-robertq-msft
Community Support

Hi, 

It seems to be a problem that exists in the Tabular editor which is related to the Power BI for a period of time. But since the Tabular editor is an external tool and the calculation groups are created by it. So I guess that it can not be completely judged as an issue in the Power BI.

You can vote for this idea as well:

https://ideas.powerbi.com/ideas/idea/?ideaid=9d9e204a-db28-4ced-89f9-ea56a1041a06&page=2

 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

edhans
Super User

@v-robertq-msft - can you please substantiate your reply? Please use whatever tool MS uses for adding calculation groups to models and see if you get different results. If you do, let me know what that tool is and I will go back to the T/E developer and file a bug report. 

I do not believe it is the case that T/E is at fault though. I believe the error is how the Smart Narrative visual handles variant data types, and a CG simply exposes this.

edhans
Super User

@v-robertq-msft - here is another PBIX file with no calculation group, but shows how the Smart Narrative fails with a variant data type in a measure whereas the Matrix visual works correctly. So definitely a Smart Narrative issue, not calc groups, nor Tabular Editor.

 

Link to PBIX file

v-robertq-msft
Community Support

Hi,

I have reported this issue internally, ICM: 261687431

 

I will update here once I get any information.

 

Best Regards,

Community Support Team _Robert Qin

edhans
Super User

Thanks @v-robertq-msft !

v-robertq-msft
Community Support

Hi,

I’ve got this message from pg:

I am able to reproduce the cx's issue. As a workaround, the cx can avoid using variant value measures, i.e., Variant Measure = IF ( TRUE () , "some text" , "other text" ). Since they specifically would like variant value measures to work, I will reach out to see if others have ideas.

 

Best Regards,

Community Support Team _Robert Qin

edhans
Super User

Thanks, and I will give that a try. However, that is not very performant. I avoid IF and SWITCH when possible on large models for complex measures because of their impact on performance, so even if I get this to work (and I see no reason why it shouldn't), it isn't a very good workaround.

Note: I am not necessarily asking for SN's to handle variant measures. I am asking they not be impacted by Calculation Groups or the existence of measures that do return Variant data types as long as those measures are not used, or CG's not applied, in the SN itself.

jaap_olsthoorn
Advocate II

This is still an annoying bug, The mere existence of a calculation group should not change all data types to variant.