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

Data shaping and columns

Hi

 

I have the below dataset

Capture1.PNG

 

Column O is a question from a survey that asks customers what word(s) best describe the service they received from us. As there are multiple choices to pick from and a respondent can pick multiple words, it splits the question and answers into a number of columns (O - V).

 

I need to use a bar graph to show how many times each word has been selected and be able to filter the visual by date. Does anyone have any suggestions/help/tutorial?

 

Thanks a lot for reading.

James

2 ACCEPTED SOLUTIONS

@Anonymous ,

 

Click query editor-> Transform-> click on the columns then click "Unpivot columns". You will achieve two columns [Attribute] and [Value]. Then create a measure using dax like pattern below:

Helpful_Count =
CALCULATE (
    COUNT ( Table[Value] ),
    ALLEXCEPT ( Table, Table[Start Date], Table[Attribute] )
)

 

Community Support Team _ Jimmy Tao

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

Anonymous
Not applicable

Thanks @v-yuta-msft 

 

I had to add a little bit in so my measure ended up looking like this:

 

Helpful_Count = CALCULATE(
COUNT(Table[Value]),
ALLEXCEPT(Table,Table[Start Date],Table[Attribute]),
FILTER(Table,Table[Value]="Helpful")
)
 
and then repeated this, changing "Helpful" for the other options that could've been selected. 

View solution in original post

6 REPLIES 6
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Change date format to yyyy/mm/dd, then create measures using dax like pattern below:

Helpful_Count =
CALCULATE (
    COUNT ( Table[Helpful] ),
    FILTER ( ALLEXCEPT ( Table, Table[Start Date] ), Table[Helpful] = "Helpful" )
)

 

The other measures is similar with the one above, you just need to change "Helpful" with other words.

 

Finally, drag date column to X-axis and measures to value field in the bar chart.

 

Community Support Team _ Jimmy Tao

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

Anonymous
Not applicable

Hi @v-yuta-msft 

Thanks for the comment.

 

I have tried the formula but I don't get the result I was hoping for.

 

I am aiming to have a visual that looks something like the below and to be able to filter it by month (using a slicer)  to show the results for the selected month.

Capture2.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Many thanks

James

 

 

@Anonymous ,

 

Click query editor-> Transform-> click on the columns then click "Unpivot columns". You will achieve two columns [Attribute] and [Value]. Then create a measure using dax like pattern below:

Helpful_Count =
CALCULATE (
    COUNT ( Table[Value] ),
    ALLEXCEPT ( Table, Table[Start Date], Table[Attribute] )
)

 

Community Support Team _ Jimmy Tao

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

Anonymous
Not applicable

Thanks @v-yuta-msft 

 

I had to add a little bit in so my measure ended up looking like this:

 

Helpful_Count = CALCULATE(
COUNT(Table[Value]),
ALLEXCEPT(Table,Table[Start Date],Table[Attribute]),
FILTER(Table,Table[Value]="Helpful")
)
 
and then repeated this, changing "Helpful" for the other options that could've been selected. 

@Anonymous ,

 

Could you please share the sample data so that I could do further analysis?

 

Regards,

Jimmy Tao

Anonymous
Not applicable

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.