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
snandy2011
Helper IV
Helper IV

how to change format of a calculated measure after using format function

Hi,

 

I need help in following situation,

 

I have calculated bounce rate, below is my formula,

 

Bounce Rate for Direct = ROUNDDOWN([Bounce for Direct] / [Entrance for Direct]*100,2)

 

and this bounce rate is included into a dynamic calculated measure.Below is the dynamic measure,

 

Measure Selection for Direct = IF(ISCROSSFILTERED( 'Measure Dimension for Direct'[Measure] ),
SWITCH( TRUE(),
VALUES('Measure Dimension for Direct'[Measure] ) = "Bounce Rate", [Bounce Rate for Direct],
VALUES('Measure Dimension for Direct'[Measure] ) = "Exit Rate",[Exit Rate for Direct] ,
VALUES('Measure Dimension for Direct'[Measure] ) = "New visitor", [New Visitor for Direct],
VALUES('Measure Dimension for Direct'[Measure] ) = "Pageviews", [Pageviews for Direct],
VALUES('Measure Dimension for Direct'[Measure] ) = "Session", [Session for Direct],
VALUES('Measure Dimension for Direct'[Measure] ) = "Entrance", [Entrance for Direct],
BLANK()),BLANK() )

 

Now i want to show bounce rate with % sign when user will select bounce rate into the slicer.

 

so for that, I have written folowing dax formula,

 

Bounce Rate for Direct = FORMAT(ROUNDDOWN([Bounce for Direct] / [Entrance for Direct]*100,2),"%")

 

but, the problem is that, when i create any visualization with this measure it shows,

 

cannnot convert value"%" of type text to type numeric.

 

it seems that, format makes this measure into text type. Can i change this type from text to numeric ? 

 

so that i can show bounce rate with % sign.

 

expected output:

suppose i  want to create a bar chart of page wise bounce rate, it should show bounce rate with % sign (such as, 16%,20% etc)

below is one screenshots,

Screenshot (70).png

 

 

i want to show the % sign of every data label.

 

will it be possible?

 

Any suggesation is really appreciable.

 

Thanks,

snandy

 

 

1 ACCEPTED SOLUTION
rudra_deep
Frequent Visitor

Hello @snandy2011, Please do not multiply the function (Bounce Rate for Direct = ROUNDDOWN([Bounce for Direct] / [Entrance for Direct]*100,2)) by 100. This will generate values in points, now go to edit queries > select the column > change values to percentage.

If the column does not show up under edit query, then kindly use the "New Column" option to add the above function and refresh the table.

 

Do le me know if it works.

View solution in original post

6 REPLIES 6
rudra_deep
Frequent Visitor

Hello @snandy2011, Please do not multiply the function (Bounce Rate for Direct = ROUNDDOWN([Bounce for Direct] / [Entrance for Direct]*100,2)) by 100. This will generate values in points, now go to edit queries > select the column > change values to percentage.

If the column does not show up under edit query, then kindly use the "New Column" option to add the above function and refresh the table.

 

Do le me know if it works.

 

The approach was really awesome.But, in my case. It did not work.Because, bounce for Direct and Entrance for direct, both are another measure.Anyway, I have achieved it by another way..
 
Thnaks once again for replying,
 
Snandy

Hello! How were you able to achieve it? I'm using the exact same code, but can't seem to format it properly. 

Thanks for reply..ok.. Let me try.I will let you know

v-yuta-msft
Community Support
Community Support

Hi snandy2011,

 

You can simply click Modeling-> Format to change type with percentage.

 

Regards,

Jimmy Tao

Hi v-yuta-msft,

 

Thanks for reply..I did it..but no solution.. is there any another way?

 

Thanks,

snandy

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.