Forum Discussion
Issues with Format Expressions in Calculation Groups
Hi MHEnsslen ,
Can you share some screenshots around the issue please? This is not helping much.
Can you share some sample data and the expected result to have a clear understanding of your question?
You can save your files in OneDrive, Google Drive, or any other cloud sharing platforms and share the link here.
Best Regards,
Yuna
In the image below (From PowerBI Desktop) you can see 3 measures in my matrix.
NIS Units and NIS $ are regular explicit measures summing up the columns in my fact table.
NIS is a dynamic measure that is supposed to allow the user to use a slicers from the Calculation Group "Unit of Measure" to be able to dynamically flip between 6 different calculation Items (List $, Sales $, Std Cost $, Std Margin $, Std Margin%, Units)
As you can see NIS $ and NIS Units have the same value no matter what Unit of Measure is selected (Expected behavior).
NIS is switching between the measures and giving me the desired results, including the formatting specified by the Format Expression on each of the Calculation Items.
The Measure "NIS" has a Format string of "FLEX" which the Format Expression is looking for to either dynamically format the result, or return the measure's set format (as it does with NIS $ and NIS Units above)
The Format Expression of the Calculation item for Units
VAR MeasureFormat = SELECTEDMEASUREFORMATSTRING()
VAR SkipConversion = MeasureFormat <> "FLEX"
RETURN
IF ( SkipConversion,
MeasureFormat,
"#,0"
)
The Expression of the Calculation item for Units
VAR Flexmeasure = SELECTEDMEASURENAME()
RETURN
SWITCH(Flexmeasure,
"NIS", [NIS Units],
"Open", [Open Units],
"Budget", [Budget Units],
blank()
)
However, when I publish this pbix to service, I get the following result.
NIS $ and NIS Units still calculate and format as expected, but the NIS measure does not, instead it returns "FLyX".
I have tried exchaning out FLEX with other strings, but to no avail. Desktop still works as expected with these other strings but service continues to return incorrect results.
Other stings will return the correct value, however with the incorrect formatting.
For example, units will show 425621405.52000001