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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
cgonzalezjr
New Member

Calculation Group format string impacting other measures

I have run into an issue with formatting a measure not part of calculation group. If I select a calculation item (defined as SELECTEDMEASURE()) that has format string defined, the unrelated measure uses that format.  For example, I selected the Profit Pct Calculation Item (with the format string expression set as "0.00%;-0.00%;0.00%") from Metric Calculation Group, the measure Distinct Customer Cnt (defined as a whole number) is displayed as 40300.00% instead of 403.  The distinct Customer Cnt meaure uses whatever format is set for the selected Metric

Setup:

2022-06-03_12-51-54.png2022-06-03_12-51-12.png

 

 

Result:

2022-06-03_13-02-23.png

 

 

1 ACCEPTED SOLUTION

Thanks that worked.  Can you explain why/how the selection of a calulation item in slicer affects the formatting of another measure?

View solution in original post

3 REPLIES 3
sturlaws
Resident Rockstar
Resident Rockstar

Hi, @cgonzalezjr,

 

in general, it is a good idea to include a pbix-file which highlights your issue. This makes it far easier to look into your issue.

 

In your case here, I think you just need to change how the slicer affects the card with the customer count:

sturlaws_0-1654288827441.png

 

to

 

sturlaws_1-1654288870119.png

 

 

Cheers,
Sturla

If this post helps, then please consider Accepting it as the solution. Kudos are nice too.

 

How to Get Your Question Answered Quickly

 

 

Thanks that worked.  Can you explain why/how the selection of a calulation item in slicer affects the formatting of another measure?

Sure,

 

the slicer adds to the filter context when your measure is evaluated. And because you have filtered on the ordial of the calculation group, e.g. 2, all measures which has this as part of their filter context will be formated as [Profit prc]


Another way to solve your issue would be to change your switch-statement to something like this:

metric = 
var _name = calculate(selectemeasurename()) return
switch(true(),
,_name = "Sales Total",[Sales total]
..
..
) 

 Since you would have to hardcode the names of the measures here, I think I prefer to change how visuals interact.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.