Forum Discussion
Need help in DAX
https://drive.google.com/file/d/1jFr3cfSQbZemjFuKX50gLS45qlQ0R0Bq/view?usp=sharing
Thanks for your response!
Actually SchoolYear will not use in slicer that will be in chart and remaining categories will be use in slicer.
PFA sampleData.
I am not able to attach document. How I can attach?
Given below is my requirement and as you can see year is a first category and second category will be select from slicer.
- v-qiuyu-msft7 years ago
Community Support
Hi Anonymous,
It looks like the Race, Gender, Ethinicity, School and Grade are not the legends of the chart visual, right?
If they are buttons, you can create different bookmarks to display the chart with different category, then link the button to desired bookmark. See: https://docs.microsoft.com/en-us/power-bi/desktop-bookmarks
Best Regards,
Qiuyun Yu- Anonymous7 years agoNot applicable
I got your point but I am trying to avoint charts and covering space in report.
Please check my first description where my DAX is not returning data.
Calculated Column1:= var StudentCount1 = CALCULATE ( DISTINCTCOUNT(FactGrades[DimStudentsWid]), FILTER ( VALUES( FactGrades[PercentGradeReceived]) , COUNTROWS ( FILTER ( 'DimReportingConfig', FactGrades[PercentGradeReceived] >= 'DimReportingConfig'[MinValue] && FactGrades[PercentGradeReceived] < 'DimReportingConfig'[MaxValue]&&NOT(ISBLANK(FactGrades[PercentGradeReceived])) ) ) > 0 ) ) RETURN IF ( HASONEVALUE(SelectiomTable[Type]), SWITCH ( VALUES( SelectiomTable[Type] ), "SchoolYear", CALCULATE ( StudentCount1, TREATAS ( VALUES( SelectiomTable[VALUES] ),SectionEnrollment[SchoolYear] ) ), "GradeLevel", CALCULATE ( StudentCount1, TREATAS ( VALUES( SelectiomTable[VALUES] ), SectionEnrollment[GradeLevel]) ) ),0 )
- v-qiuyu-msft7 years ago
Community Support
Hi Anonymous,
From your source data (https://drive.google.com/file/d/1jFr3cfSQbZemjFuKX50gLS45qlQ0R0Bq/view), the table FactGrades doesn't contain Type and VALUEs columns, I guess you do transform for the table in Query Editor.
As I don't know how the data model it is, it's hard to provide further help. If possible, please share the pbix file and clarify the desired results of Calculated Column1.
Best Regards,
Qiuyun Yu