Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

Count Campus visit with multiple payor

I have data of sale and payor. There are some who paid by Insurance, while some were Selfpay. We want to count those who has payment in both type. That mean the expense are exceeeded insurance limit and we want to help them.


Each customer "hn" in both f_visit_info and f_bill_info table will related to multiple "bill_id" in f_bill_info table , while each "bill_id" will only has one "payor_group".

The original code are below, but the calculate for "Insurance with Selfpay" always return blank.

Insurance With Selfpay = CALCULATE(
   [Campus Visit],
   OR(f_bill_info[payor_group] = "Local Insurance", f_bill_info[payor_group] = "Inter Insurance"),
   f_bill_info[payor_group] = "Selfpay"
::: Campus visit definition is Distinctcount(hn,date)
Campus Visit =
VAR _table = SUMMARIZE('f_visit_info','f_visit_info'[visit_date],"distinctcount",DISTINCTCOUNTNOBLANK('f_visit_info'[hn]))
Community Support
Community Support

Hi @tanat_inc 


Could you share some dummy data and expected result more clearly? Multiple tables and columns are involved in your measures. It's difficult to create a proper measure without knowing the data and relationships between tables. 


If the measure always returns blank, you could remove some filters from the code to check from where it starts to show blank. 


Community Support Team _ Jing

Helpful resources

PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Top Solution Authors
Top Kudoed Authors