TabularEditor icon indicating copy to clipboard operation
TabularEditor copied to clipboard

Power BI Visuals not honoring format strings in 1500 CM model with Calculation Groups?

Open o-o00o-o opened this issue 6 years ago • 45 comments

Hi guys, not sure yet if this is a Power BI, AAS or a Tabular Editor issue but we have found that our new 1500 cube with calculation groups is not behaving correctly in Power BI

Power BI Matrix/Table and Cards work correctly but all of the visuals (line/bar/pie etc) do not honour the format string

e.g. left is a table, right is a bar chart for the same Axis/measure image

Other things I've noticed

  • In Power BI we see every measure duplicated - the dupe holds the value for the format string and is always hidden

image

  • Excel pivot tables with live connection to the AAS work correctly

This model was built and deployed with Tabular Editor. Not sure if deploying with the MS tool might make any difference but that is one thing that I would like to try.

Any other ideas on what might be causing this? Seems a pretty major issue that I would have thought Microsoft would have found during their dev/test...

o-o00o-o avatar Jan 09 '20 10:01 o-o00o-o

I suggest you to open a ticket with Microsoft support as soon as possible. For the first issue: it should depend on the visuals, for sure any custom visual should not work with dynamic format string, whereas the native Card visual should work correctly. I'm not sure about other visuals, but it is possible that there are visuals not working. I already raised the issue months ago with Microsoft, but as usual only tickets from customer can help to escalate the issue.

The second one (duplicated measures) is weird and I didn't notice it before. However, it's something that Microsoft has to fix in Power BI.

So my suggestion is to open two different tickets for the two issues, because they involve different teams within Microsoft and you will streamline the process this way. Please forward the ticket ID here when you have them - thanks!

marcosqlbi avatar Jan 09 '20 10:01 marcosqlbi

Thanks Marco, thats a real shame and will prevent us from being able to release Calculation Groups at all. Surprising that it affects all our existing normal measures, but I guess they have had to change the whole format string system without any backward compatibility.

Card, Multirow card, Table and Matrix honour the format string. All the other standard visuals do not.

I guess custom visuals will be upgraded over time, or is the ability not yet provided to the custom visuals?

The first issue ticket number is 120010922001023 The second issue ticket number is 120010922001266

o-o00o-o avatar Jan 09 '20 11:01 o-o00o-o

@o-o00o-o I would recommend holding off on deploying Calculation Groups/1500 models until at least CU2. We are tracking a pretty nasty issue right now with tons of BLANK()s coming seemingly from out of nowhere, and MS is tracking CU2 for our fix in particular. Thank you for filing your bugs; hopefully these issues shake out soon. Calculation Groups are incredible.

dmarkle avatar Jan 12 '20 03:01 dmarkle

Closing this as neither of these issues can be resolved within Tabular Editor (it's simply just using the TOM to apply the changes - you would get result by manually creating a calc group through TOM or through the use of a TMSL script). Please raise a ticket with Microsoft as suggested by Marco.

otykier avatar Jan 14 '20 10:01 otykier

Just for visibility, the Power BI support team are now agreeing this is a known limitation and that it isn't planned to be developed until summer this year with no delivery ETA.

This means that we (and I'm sure most existing cubes with Power BI reports against them) will be prevented from using calculation groups until them

I've created a community post with the details here.

https://social.msdn.microsoft.com/Forums/en-US/3c71faf0-6613-4ed2-b34b-48961732f514/adding-a-single-calculation-group-to-aas-breaks-most-of-the-existing-company-power-bi-reports?forum=AzureAnalysisServices

@marcosqlbi I'm not sure if you or Alberto are able to help with your MS contacts to make sure this is put in front of the product owners - feels like a big oversight to me and I'm willing to be whoever decided on the priority of this wasn't aware that this would break existing reports that don't even use calculation groups.

o-o00o-o avatar Feb 17 '20 13:02 o-o00o-o

Thanks for letting us know. Just out of curiosity, have you specified FormatStringExpressions for any of the Calc Items in your Calc Group? What happens if you specify SELECTEDMEASUREFORMATSTRING() as the FormatStringExpression across all your calc items?

otykier avatar Feb 17 '20 13:02 otykier

yeah we tried all of that when we initially saw the problem. It makes no difference, Power BI just isn't looking in the right place for these non-table visuals

In the basic example with a Date Calculations table with a "YOY %" then yes, you have to provide a format string to have this present the number as a % instead of the selectedmeasure's formatstring.

As soon as you add a calculation group to a model, Analysis Services dramatically changes the model in how it provides the queries with the format string to apply.

Suddenly every measure now has 2 measures with the same name (the measure itself and also the measure containing the format string) - you see it in both power bi and dax studio

image

So now the query tools need to write queries that return the format string for this specific context, rather than just being able to take the format string from the measure.

It is a shame they didn't implement Format Strings in the same way they did for Data Types as this is provided as metadata with the resultset - although now you have to check per cell of results, again instead of being able to just get the datatype from the column definition.

o-o00o-o avatar Feb 17 '20 14:02 o-o00o-o

The issue is bigger than I realized initially. I discovered this because custom visuals were not supporting dynamic format strings. But the fact that this breaks standard format string... well this is huge. I tried to raise awareness of the issue in MS pointing to the blog post in the Microsoft forum, let's see what happens in 1-2 days otherwise we'll escalate making it more visible in a blog post.

marcosqlbi avatar Feb 17 '20 15:02 marcosqlbi

I guess the reason it’s not implemented as metadata is because you can have different format strings in the same column for different rows, whereas the data type is always the same across all rows for any given column. So they probably had to come up with a different implementation in which the format string is returned in a separate column.

otykier avatar Feb 17 '20 15:02 otykier

@marcosqlbi Thanks for your support on this, Yes it is a massive issue as it breaks static format strings for normal measures. Appreciate anything that you can do to raise awareness about this. Considering most people using AAS/Cube are now using Power BI, it means that this great feature from the AAS team cannot be used by anyone due to this bug in Power BI. The problem was it was hidden as we did all our testing on our Calculation Groups using Matrix and Table visuals. Only when we released, immediately users were complaining that their existing charts with % measures were now showing as unintuitive decimal numbers without any format string applied.

@otykier Well, interestingly this is now the same for datatypes, As soon as you add a Calculation Group to a model, all measures have their datatype changed to variant and now the datatype can be changed for each cell rather than by each column for a similar reason as now the output of a Calculation Item being applied to a measure can change its data type. If you check the output of a DAX query (like using Invoke-AsCmd.ps1) it now indicates the output datatype per cell instead of for each column in the header area (as it used to). So I'm not sure why they didn't use this same method for Format Strings tbh.. perhaps there is a reason, or maybe two different approaches to the same problem.

o-o00o-o avatar Feb 19 '20 18:02 o-o00o-o

The MS forum suggested I create a Idea so I did that here https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/39750307-format-strings-don-t-work-on-a-ssas-model-with-cal

o-o00o-o avatar Feb 19 '20 19:02 o-o00o-o

The issue with measures changing their data types to variant is familiar. It happens when you have calculation items that do not follow certain patterns, such as CALCULATE(SELECTEDMEASURE(), ...) where the data type is guaranteed to not change. These patterns are unfortunately not documented, as far as I know. If you have any calc items that doesn’t follow this pattern, they have to decay all measure data types to variant.

As to the issue with format strings, here is some speculation on what I think is going on. Maybe @marcosqlbi knows the internals in more details.

Invoke-AsCmd actually uses XMLA to send the command to the model, meaning the returned result is a cellset, which explains why the data type is specified for each cell. On the other hand, when querying the model with an OLEDB connector, we get a flat dataset as the result, where its not possible to have differing data types per cell. I’m guessing Power BI uses the latter or another similar protocol that returns a flat dataset. You probably don’t see this issue with the format strings in Excel. That’s because Excel also uses XMLA, but since it uses XMLA with MDX it’s also able to get the format string per cell.

As to the fix: Microsoft either needs to make sure that all visuals query the hidden format string measures for every measure that is being used in the visual, as well as ensure that the visual actually applies that format string when rendering the value. Alternatively, they should query the model using XMLA and consume the returned cellset, but this probably requires much more effort.

otykier avatar Feb 19 '20 19:02 otykier

The issue with the visuals is that are different types of visual, and depending on that, they manage variant or not. It seems this is an unfinished work and this is the behavior they probably have also when they connect to Multidimensional. The only thing we can do is to give more visibility and hope other big customers raise the issue with Microsoft.

marcosqlbi avatar Feb 19 '20 21:02 marcosqlbi

@otykier well, the XMLA thing definately changed either due to switching to CM 1500 or by adding a Calculation Group to the Model as we have to modify our Automated Test tools. Previously we could use a datatype indicator in the header of the XMLA result but then we had to switch to cope with the datatype in each cell as the header just said variant now. Perhaps it was there before but we didn't need it as it was good enough to refer to the header one so we could tell numeric types for tolerance in our test tools.

@marcosqlbi the support team did mention something about it being a known issue for MD.

So what you guys might be suggesting is that if I can stop the measures all changing to variant (perhaps with identifying that pattern) then perhaps we can work around this issue.

I will definitely give that a go.. although it may not be easy or possible in our case for it to really do what we want..

o-o00o-o avatar Feb 21 '20 18:02 o-o00o-o

Hi folks, I have the same issue here, and I have discovered something that might help in the struggle. The thing is, in my case, I find the following:

  • When Calc groups are added to the model, yes, the measures become variant. But this is not an issue by itself!...
  • If all FormatStringExpression of all Calculation Items are empty, then the behaviour of measures is unchanged (at least in my testings) - the usual format strings of normal measures are properly shown in graphs, business as usual, all happy
  • If afterwards, I add just one FormatStringExpression to ANY of the Calculation Items, (including SELECTEDMEASUREFORMATSTRING() or any other), then the bug arises and graphs in PowerBI do not respect their source formatting (matrix is OK as you have reported)

So in my case, it looks that the problem does not come from just 1500, or from adding calculation groups, but from adding a single FormatStringExpression to the model. Therefore, in my case so far I am able to add Calculation Groups and Items without and issue to an existing model (phew!), but not use the custom format feature.

I hope this helps shed some light, and yes, Microsoft should solve this!

Best regards, Martin

zenzeinet avatar Feb 23 '20 20:02 zenzeinet

Another breaking change I just found is that I have some format strings set to the words "Short Date" in my model in TE.

That's all broken now; instead of giving me what I expect, my dates are displaying as "S12orA DaAe" -- evidently all format strings need to be explicit!

On Sun, Feb 23, 2020 at 3:13 PM zenzeinet [email protected] wrote:

Hi folks, I have the same issue here, and I have discovered something that might help in the struggle. The thing is, in my case, I find the following:

  • When Calc groups are added to the model, yes, the measures become variant. But this is not an issue by itself!...
  • If all FormatStringExpression of all Calculation Items are empty, then the behaviour of measures is unchanged (at least in my testings) - the usual format strings of normal measures are properly shown in graphs, business as usual, all happy
  • If afterwards, I add just one FormatStringExpression to ANY of the Calculation Items, (including SELECTEDMEASUREFORMATSTRING() or any other), then the bug arises and graphs in PowerBI do not respect their source formatting (matrix is OK as you have reported)

So in my case, it looks that the problem does not come from just 1500, or from adding calculation groups, but from adding a single FormatStringExpression to the model. Therefore, in my case so far I am able to add Calculation Groups and Items without and issue to an existing model (phew!), but not use the custom format feature.

I hope this helps shed some light, and yes, Microsoft should solve this!

Best regards, Martin

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/otykier/TabularEditor/issues/380?email_source=notifications&email_token=AA5N5TL5Z3HHWUJ4YVYPMHDRELKHDA5CNFSM4KEWBB42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMWGA2Q#issuecomment-590110826, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5N5TJFX4RLMLLFN3ZWEDDRELKHDANCNFSM4KEWBB4Q .

dmarkle avatar Feb 26 '20 17:02 dmarkle

@zenzeinet thank you for sharing this!

Actually this does provide an ok workaround so at least we can deploy the Calculation Groups to live and have our tests continue to work.

It just means that for the few calculation groups that require % format strings, these will still show as 0.01 etc. I can't see a good workaround for this, although I may want to try creating a new base measure that just presents as a % and see if this can work as without a format string it seems to automatically pick up the base measure format string.

o-o00o-o avatar Mar 02 '20 15:03 o-o00o-o

@o-o00o-o Yes, that is what we are currently doing. It is too bad, as the custom formating would be very nice in quite a few situations (and I cannot even add it selectively - it is all or nothing). Currency exchange, % measures, ratios, showing +/- simbols, custom dynamic units (eg showing Kb, Mb, Gb) etc.

I'm hoping microsoft addresses this bug, and for us the wait is at least a few months, as we're running PBIRS which updates 3 times per year. Hopefully it should be done next release, but what a bummer they did not find this in testing. I personally found the bug too and was initially blaming myself for not finding the proper setting in a line graph, thinking "damn, I'm quite sure this was showing %s properly before..."

Best regards

zenzeinet avatar Mar 03 '20 18:03 zenzeinet

Hi, It seems Microsoft has started the work: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/39750307-format-strings-don-t-work-on-a-ssas-model-with-cal Unfortunately it seems it will take them several months... if Marco, Daniel or anyone reading this could push them a little it would be great. Best regards

zenzeinet avatar May 08 '20 11:05 zenzeinet

We have no power to push it - it's just good it's now in their roadmap.

marcosqlbi avatar May 08 '20 12:05 marcosqlbi