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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
tanat_inc
Helper II
Helper II

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]))
RETURN CALCULATE(
   SUMX(_table,[distinctcount]),
      USERELATIONSHIP('d_date_table'[Date],'f_visit_info'[visit_date]),
      USERELATIONSHIP(d_age_group[ageyear],f_visit_info[visit_ageyear])
)
1 REPLY 1
v-jingzhang
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. 

 

Regards,
Community Support Team _ Jing

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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