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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
RJR71
New Member

Translate "++" into a value and do a calculation

Hi,

 

I have 2 problems and I could not find a good answer. I belive it is no big deal in DAX, but I do not know how to do it.

I did a survey with MS-Forms. Thereby ++ stood for very good, 0 for neutral and -- for very bad.
Now I got a table like this:

ZielBild
++
+
0
-
--

 

But I need a sum as well as a mean value (Average value). If I take ++=2; +=1; 0=0; -=-1 and --=-2, the table would look like this:

ZielBildRepresents Value
++2
++2
+1
--1
00
---2
  
SUM2
Avarage0,333


My second problem is very similar. How do I get the sum (blue row) at the end?

2. Example    SUM
++---++1
2-2-1111


Thank for your help in Advance.

RJR

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @RJR71 

According to your two expected tables, I think you can simply achieve this using the Matrix visual in the Power BI, you can try my steps:

  1. To get the first table, you can create a matrix and place it like this:

v-robertq-msft_0-1618555377856.png

 

You can change the summarize type of the total row and change the name of the total row like this:

v-robertq-msft_1-1618555377859.png

 

  1. To get the second table, you can create a matrix and place it like this:

v-robertq-msft_2-1618555377883.png

 

And you can get what you want.

You can download my test pbix file below

 

More info about the matrix visual in Power BI

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

View solution in original post

3 REPLIES 3
RJR71
New Member

Is solved the problem in the table by replacing the "Symbols" with numbers. My problem was, that I did not see, that all columns must be "Text" to do it. I had some as a number, and so I got errors by updating the table.

 

But thanks to all!!! You helpt me a lot with your answers.

THANKS

 

RJR

v-robertq-msft
Community Support
Community Support

Hi, @RJR71 

According to your two expected tables, I think you can simply achieve this using the Matrix visual in the Power BI, you can try my steps:

  1. To get the first table, you can create a matrix and place it like this:

v-robertq-msft_0-1618555377856.png

 

You can change the summarize type of the total row and change the name of the total row like this:

v-robertq-msft_1-1618555377859.png

 

  1. To get the second table, you can create a matrix and place it like this:

v-robertq-msft_2-1618555377883.png

 

And you can get what you want.

You can download my test pbix file below

 

More info about the matrix visual in Power BI

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

HotChilli
Super User
Super User

You can add a calculated column which gives the numeric value for each text value.  You can do this with an 

IF or SWITCH statement e.g. 

AltColumn = SWITCH (
    [ZielBild],
    "++", 2,
    "--", -2,
    the other cases,
    0
)

 

Write two measures using the new column. One with SUM, one with AVERAGE.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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