Forum Discussion
thmpsne
6 years agoFrequent Visitor
Survey Data - Unpivoting Causing Issues?
Hi everyone, This is my first time posting so please forgive me if it's rough! I'm relatively new to PowerBI, and my DAX is very basic. In my role, we are moving toward using PowerBI to present...
- 6 years ago
Just testing againts your sample I created a couple measures.
Student Count = DISTINCTCOUNT ( 'Table'[Student ID] )
Industry = CALCULATE( [Student Count], 'Table'[Question Code] = "example_industry")
Job Title = CALCULATE( [Student Count], 'Table'[Question Code] = "example_mainrole - Job Title")
They work when you apply filters on say the student so it should work with filtering on other columns in your data as well.
Anonymous
6 years agoNot applicable
Hi,
Check if this measure helps:
Survey Measure =
VAR v_SurveyCnt = CALCULATE
(
DISTINCTCOUNT( SurveyData[Student ID] ),
ALLEXCEPT( SurveyData, SurveyData[Question Code], SurveyData[Response Value] ) ,
FILTER( SurveyData, SurveyData[Question Code]="example_industry" )
)
RETURN
v_SurveyCntThanks.
thmpsne
6 years agoFrequent Visitor
Hi Anonymous - This 'works' but doesn't return the correct values when I use it in my actual dataset.
It also doesn't solve the issue of filtering values that are in the same column as values for other visualisations.
- jdbuchanan716 years agoSuper User
Just testing againts your sample I created a couple measures.
Student Count = DISTINCTCOUNT ( 'Table'[Student ID] )
Industry = CALCULATE( [Student Count], 'Table'[Question Code] = "example_industry")
Job Title = CALCULATE( [Student Count], 'Table'[Question Code] = "example_mainrole - Job Title")
They work when you apply filters on say the student so it should work with filtering on other columns in your data as well.