cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
KKirsten
Frequent Visitor

Sum data with custom suffix

Hey,

 

i'm trying to make my report a little bit more user-friendly by adding a custom suffix (in this case GB to show that my numbers are in Gigabytes). I added the suffix via the PowerQuery Editor:

= Table.TransformColumns(#"Geänderter Typ", {{"DriveSize", each Text.From(_, "de-DE") & " GB", type text}})

The problem is, that this changes the data format to "Text", which makes it impossible to calculate with. Does PowerBI have a feature similar to Excel, where i can add user defined formats for numbers or is there any other way?

 

Thanks!

4 REPLIES 4
Super User III
Super User III

Re: Sum data with custom suffix

Hi, @KKirsten,

 

there is no equivalent function in Power BI. You could try to use the concatenate function in a measure, and see if that helps:  concatenate(sum(value)," GB")

KKirsten
Frequent Visitor

Re: Sum data with custom suffix

Hey @sturlaws ,

 

that really helped for the first step. Thanks! Now i wanted to add a thousands seperator. That does not seem to work, since the measure is considered a text, too.

 

Greetings!

Community Support
Community Support

Re: Sum data with custom suffix

Hi @KKirsten ,

It is not supported to calculate values with suffixes. You need to calculte firstly, then add the suffixes.

You could try the following formula to implement the requirement. But it is still showed as text .

Column = FORMAT('Table'[VALUES],"#,##GB")

1.PNG

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
KKirsten
Frequent Visitor

Re: Sum data with custom suffix

Hey @v-xuding-msft ,

 

the format looks great with your solution but the problem is, that i'm using a table to display the drive sizes of different virtual machines. In the raw data, there could be several records for one VM. i.e.

VM-DC-01   100      E:
VM-EX         900     D:
VM-FS       2000     F:
VM-DC-01     50     C:

So for the VM "VM-DC-01", my table should display the total (summed up) drive size of "150 GB". With your solution, i can't change to sum in the visual options for that field:

Power BI Desktop.png

But by combining yours and @sturlaws solution, i came as close as i can get! 🙂 So thanks to the both of you!... (I would have to mark both of your comments as accepted solution... what's the best way to do that?)

 

I ended up with this measure, which works fine so far:

GB_Test = FORMAT(SUM('Table'[DriveSize]);"#,## GB")

Thanks to the both of you!

 

Edit (29.07.2019 08:55):

Now i found the downer for this solution. I can't sort by size in my table. The data gets sorted as text, which is not want i want (the screenshot shows a table where virtual machines are grouped by customer. Similar to the sample above) 😞

01_Power BI Desktop.png

 

Helpful resources

Announcements
‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors