Forum Discussion
Apply filters then Count Distinct observations
Hi,
I am trying to figure out how to count observations in a very particular way. my sample data and the resulting table I want to replicate in Power Bi are displayed in the image below.
I have a table of students who visited different schools in our district. I need need to count unique observations but I also need to give credit to each school for serving the student. In excel I do this by manually filtering the table by school year, school and month then counting the number of observations. I have tried myltiple dax formulas but have been unsussucessful in creating something that replicates this counting method. I want to have this in one visual just like I created in the excel sheet. Any help would be appreciated. Thanks
1 Reply
- v-jiascu-msft
Microsoft Employee
Hi Anonymous,
Please download the demo in the attachment. If you need the visual to show 0, a measure is needed.
ID Counts = VAR temp = DISTINCTCOUNT ( Table1[Visitor ID] ) RETURN IF ( ISBLANK ( temp ), 0, temp )Best Regards,
Dale