Forum Discussion
Counting responses within multiples fields and combining into a column chart
- 2 years ago
Anonymous you need to unpivot your data. Transform data -> select first two columns -> right click -> Unpivot other columns.
It will give you two columns, attribute and value, rename these columns if you want. Close and apply.
Add following measure:
Fail Count = CALCULATE ( COUNTROWS ( Table ), Table[Value] = "Fail" )To visualize, use attribute on x-axis and above measure (Fail Count) on values and that will do it.
- 2 years ago
Hi,
you can produce with switch and static table:1. create 5 measures for your columns :
Cnt COL = CALCULATE(COUNTROWS(DD),FILTER(DD, DD[Check Oil Lvl]="Fail")) Cnt GG = CALCULATE(COUNTROWS(DD),FILTER(DD, DD[Grease Gun]="Fail")) Cnt Ins = CALCULATE(COUNTROWS(DD),FILTER(DD, DD[Inspection/Defect Book]="Fail")) ....2. Create Table with Colun Names and Ordering what you want
3. Create Measure with Switch:
Mes Matrix = SWITCH( SELECTEDVALUE(ForSwitch[ColName]), "Check Oil Lvl",[Cnt COL], "Water Lvl",[Cnt WL], "Thorough Exam/Test Cert In Date", [Cnt TE], "Inspection/Defect Book", [Cnt Ins], "Grease Gun",[Cnt GG], "Rope Spray",[Cnt RS] )4. add on chart this way:
5.
Enjoy Power BI
Hi,
you can produce with switch and static table:
1. create 5 measures for your columns :
Cnt COL = CALCULATE(COUNTROWS(DD),FILTER(DD, DD[Check Oil Lvl]="Fail"))
Cnt GG = CALCULATE(COUNTROWS(DD),FILTER(DD, DD[Grease Gun]="Fail"))
Cnt Ins = CALCULATE(COUNTROWS(DD),FILTER(DD, DD[Inspection/Defect Book]="Fail"))
....2. Create Table with Colun Names and Ordering what you want
3. Create Measure with Switch:
Mes Matrix =
SWITCH(
SELECTEDVALUE(ForSwitch[ColName]),
"Check Oil Lvl",[Cnt COL],
"Water Lvl",[Cnt WL],
"Thorough Exam/Test Cert In Date", [Cnt TE],
"Inspection/Defect Book", [Cnt Ins],
"Grease Gun",[Cnt GG],
"Rope Spray",[Cnt RS]
)4. add on chart this way:
5.
Enjoy Power BI
- Anonymous2 years agoNot applicable
Fantastic, thank you.
It looks like any addiitonal columns will need to be manually added buyt this should be a reaosnably rare occurence.
Thank you for your help.