Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Request for help:
I have two columns 'type' and 'VALUES' (in screenshot) in table and another table is facttable that contains detail so that i am trying to show similer data in Calculated Column1 which will show measure only.
I have written below expresssion but I am not getting data even not getting any error. Please have a look on return condition.
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 )
Hi @TejeshGour,
Please provide some sample data of facttable, and clarify the desired output based on the data in screenshot and facttable sample data.
Best Regards,
Qiuyun Yu
I am trying to create dynamic category using slicer component.
Below is expression to created table in SSAS TOM MODEL:
var Race= CROSSJOIN(ROW("Type","Race"), VALUES(DimStudents[RaceName]))
var Gender= CROSSJOIN(ROW("Type","Gender"), VALUES(DimStudents[GenderName]))
var Hispanic = CROSSJOIN(ROW("Type","Hispanic"), VALUES(DimStudents[HispanicName]))
var SchoolYear= CROSSJOIN(ROW("Type","SchoolYear"), VALUES(SectionEnrollment[LatestSchoolYear]))
var SchoolName= CROSSJOIN(ROW("Type","SchoolName"), VALUES(DimSchool[SchoolName]))
return UNION(Race,Gender, Hispanic,SchoolYear,SchoolName)
SchoolYear will be fix category and remaining will be based on selection
Hi @TejeshGour,
The FactTable link is not accessible. Please double check it.
For your screenshot, it looks like there are four legends (Gender, Race, SchoolYear, SchoolName) display in the chart, you would like to keep the SchoolYear displaying regardless any filter will filter out SchoolYear, right? I'm afraid this is not supported currently.
Best Regards,
Qiuyun Yu
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.
Hi @Tejesh_Gour,
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
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 )
Hi @Tejesh_Gour,
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
Hi @TejeshGour,
Thank you for your information. I'm able to view the sample data shared by you here: https://drive.google.com/file/d/1jFr3cfSQbZemjFuKX50gLS45qlQ0R0Bq/view
Would you please clarify the desired results based on this data?
Best Regards,
Qiuyun Yu
User | Count |
---|---|
127 | |
108 | |
99 | |
63 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |