Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
mhernandez77
Frequent Visitor

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

 

 

 

Power Bi Question.PNG

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @mhernandez77,

 

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 )

Apply-filters-then-Count-Distinct-observations

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-jiascu-msft
Employee
Employee

Hi @mhernandez77,

 

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 )

Apply-filters-then-Count-Distinct-observations

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.