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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Dynamic Format String Using Calculation Groups not acting as expected in visuals with Drill Down

Hello Community

I'm using Power BI Desktop RS version May 2021 (A must from the customer). I have some visuals that use a Measure that returns different measures based on user selection (Cost if the user selects Cost from a slicer, Number of customers if the user chooses Customers from the same Slicer...).

Now, as the measure returns values with different natures, I had to manage the dynamic formatting of that measure using Calculation groups in Tabular Editor as follows : 

  • Expression: Returns the value of the measure: SELECTEDMEASURE()
  • Format String Expression: Returns a different format based on the user's selection from a slicer:

 

 If (
SELECTEVALUE('Measure Selection'[Measure Id], 1) = 1
, "$#,0.0" // Cost value with only one decimal
, "#,0" // Absolute Value without decimals
)​

 

On most visuals, everything works well. However, I recently noticed that for visuals where the same field is dropped in the Axis and the Legend, the dynamic formatting is messed up and the visual shows the value to the smallest decimal available (My values have around 10 decimals)

Did anyone meet this kind of issue in the past?

 

Thank you for any help or any reference you could share 

0 REPLIES 0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.