cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

## Adding Columns for results of survey that get zero responses.

This is some data of before and after students take a class:

 Question1 Before Question 1 After A A B C C C C C D C C C C C C C A A B C

Before, students selcted A, B, and C as answers. After most of them realized C was the correct answer. Some still selected A, but none selected B. However, in my final graph, I only can chart A and C. How would I include that B is 0?

1 ACCEPTED SOLUTION
Resolver II

If you're willing to change your table layout slightly,  this is fairly simple. Use three columns: Question #, Before, After.

Then, you can create a calculated column for each answer type A, B, and C in your Before and After groups:

beforeA = IF([Before]="A",1,0)

beforeB = IF([Before]="B",1,0)

beforeC = IF([Before]="C",1,0)

afterA= IF([Before]="A",1,0)

afterB = IF([Before]="B",1,0)

afterC = IF([Before]="C",1,0)

Finally, then you graph the before and after results.

2 REPLIES 2
Community Champion

@travbum

hi, creating a measure like this:

```COuntQ =
VAR COUNTING =
CALCULATE (
COUNTROWS ( Table2 ),
FILTER (
ALL ( Table2 ),
Table2[Question 1 After] = VALUES ( Table2[Question1 Before] )
)
)
RETURN
IF ( COUNTING > 0, COUNTING; 0 )```

and i the visual chart select the fields in this way;

Lima - Peru
Resolver II

If you're willing to change your table layout slightly,  this is fairly simple. Use three columns: Question #, Before, After.

Then, you can create a calculated column for each answer type A, B, and C in your Before and After groups:

beforeA = IF([Before]="A",1,0)

beforeB = IF([Before]="B",1,0)

beforeC = IF([Before]="C",1,0)

afterA= IF([Before]="A",1,0)

afterB = IF([Before]="B",1,0)

afterC = IF([Before]="C",1,0)

Finally, then you graph the before and after results.

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors