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.

Reply
Anonymous
Not applicable

Display unit for dynamic measure

I am creating a scatter plot between X and Y axis 

 

On X axis slicer, we can select : Sales , GM , GM% , Sales%

On Y axis slicer, we can select : Sales , GM , GM% , Sales%

 

I have created a dynamic Measure using Switch function to get the desired result for the combination. Suppose we have selected GM in x axis and Sales % in Y axis. We will get the result based on that particular selections.

 

Issue :

Sales% and GM display unit will be in "General" format (Even if i put then as Auto in setting). I need them to be based on output of dynamic function. Like Sales% on Y axis should shown as %age's and GM on X axis in Thousands.

 

Please suggest , if thats possible in Power BI DAX

 

1 ACCEPTED SOLUTION

We can achieve dynamic formatting using Format in below way. This is working in Table but yes I am not able use this in Scatter chart. Might be a limitation of Scatter chart, needs to be explored further.

Y-axis Selection = switch(true,
SELECTEDVALUE('Y axis'[Y Axis]) = "Sales", Format([T_Sales],"General Number"),
SELECTEDVALUE('Y axis'[Y Axis])= "Sales %",Format([Sales%_PC],"Percent"))

Thanks
Ankit Jain

Do Mark it as solution if the response resolved your problem. Do like the response if it seems good and helpful.

View solution in original post

3 REPLIES 3
AnkitBI
Solution Sage
Solution Sage

Try using Format function in Power BI.

 

Thanks
Ankit Jain

Do Mark it as solution if the response resolved your problem. Do like the response if it seems good and helpful.

Anonymous
Not applicable

Thanks for quick response Ankit . 

 

The solution you told , will convert those values to text and will not be displayed in scatter plot chart (Need is get display units in %age format).

I need the "display units" settings to show as percentage/ number based on output of the dynamci measure

 

 

measure  Yaxis 

 

Y-axis Selection = switch(true,
SELECTEDVALUE('Y axis'[Y Axis]) = "Sales", [T_Sales],
SELECTEDVALUE('Y axis'[Y Axis])= "Sales %",[Sales%_PC]*100,
SELECTEDVALUE('Y axis'[Y Axis]) = "Quantity",[T_QTY],
SELECTEDVALUE('Y axis'[Y Axis])= "Quantity %", [QTY%_PC]*100,
SELECTEDVALUE('Y axis'[Y Axis])= "GM", [T_GM],
SELECTEDVALUE('Y axis'[Y Axis])= "GM %", [GM%_PC]*100,
SELECTEDVALUE('Y axis'[Y Axis])= "COGS", [T_COGS],
SELECTEDVALUE('Y axis'[Y Axis])= "COGS %", [COGS%_PC]*100,
SELECTEDVALUE('Y axis'[Y Axis])= "ASP", [ASP],0)

 

 

Similarly i had made a for X axis selction too.

 

Hope i am clear , just wanted to check if there is any work around to that.

 

 

 

We can achieve dynamic formatting using Format in below way. This is working in Table but yes I am not able use this in Scatter chart. Might be a limitation of Scatter chart, needs to be explored further.

Y-axis Selection = switch(true,
SELECTEDVALUE('Y axis'[Y Axis]) = "Sales", Format([T_Sales],"General Number"),
SELECTEDVALUE('Y axis'[Y Axis])= "Sales %",Format([Sales%_PC],"Percent"))

Thanks
Ankit Jain

Do Mark it as solution if the response resolved your problem. Do like the response if it seems good and helpful.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.