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
nightingale03
Regular Visitor

Comparison of results over years and outstanding entries

Hey All,

 

I am trying to replicate a report into Power BI.

 

I have a Full Client list, which has a many-to-one relationship with the survey result table.

 

These surveys are conducted 1st per quarter (3 month period).

 

The results are reported monthly, against that period.

 

I have the result count part reasonablitly solved, the bit i can't seem to create a measure of is how many results are "outstanding". ie no related entry in the right table.

 

the desired result would be a matrix table, with the counts of the results:

 

Client Name || Bad Fail || Fail || Pass || Excellent Pass || Outstanding

 

 

Any help would be appreciated.

12 REPLIES 12
v-huizhn-msft
Employee
Employee

Hi @nightingale03,

I try to reproduce your scenario, but it's really hard to do it without your sample table. Could you please share your sample table and expected result, so that we can post solution which is close to your requirement.

Best Regards,
Angelia

Thanks for your reply, i have uploaded simple example dataset to here

Hi @nightingale03,

The link is invalid, please update.

Thanks,
Angelia

TBL_Customer
   
Customer IDCustomer NameArea
1OxfordBlue
2CambridgeBlue
3BristolBlue
4LondonYellow
5GlasgowYellow
6Milton KeynesPurple
7BedfordRed
8LutonRed

 

TBL_Results
NUMBERTEXTTBL_CUSTOMER.Customer IDDATENUMBERNUMBERNUMBERNUMBER
Result_IDResult_TypeCustomer_IDResult_DateResult_OutcomeResult_PeriodResult_FQResult_FY
1Full101/01/201651116
2Full115/01/201761117
3Full203/01/201651116
4Full304/01/201641116
5Full310/01/201751117
6Full410/01/201641116
7Full420/01/201731117
8Full502/01/201761117
9Full619/01/201741117
10Full730/01/201651116
11Full820/01/201721117
12Partial821/01/2017411

17

 

desired results:

 

RESULTS ARE FOR QUARTER (Report Filtered?)      
           
           
  Count of ResultsAny Customer without a result in PeriodTOTAL = Total in tbl_customer
  0123456UnclassifiedTotal
Blue2016    12  3
 2017     1113
Yellow2016    1  12
 2017   1 1  2
Purple2016       11
 2017    1   1
Red2016     1 12
 2017  1 1   2

Hi @nightingale03,

Thanks for your detailed sharing. If there is relationship between the two tables? And what's the rule of calculating "Any Customer without a result in Period" and "TOTAL = Total in tbl_customer"?

Best Regards,
Angelia

Hi,

 

Customer_ID is the relationship.

 

correct on the total line, total number of customers.

 

 

Thanks,

Ben

 

Hi @nightingale03,

But I still how to calculate the "Any Customer without a result in Period" and "TOTAL = Total in tbl_customer", could you please give me an example?

Best Regards,
Angelia

That is the issue i am having, in a manual sense it would be 

Total Customers - Total Customer Results = Unclassified in Period

Hi @nightingale03,

I am still confusing your expected result. Could you explain how to get the "Count of result"(column highlighted in red line), "Any customer without a result in Period"(column highlighted in black line)? There are extra several columns(part highlighted in blue line), what the meaning and how to get them? The most strangely, there is an extra row(highlighted in yellow backgroud)? Please please share more details, so that we can give solid solution.

1.PNG

Best Regards,
Angelia

Hi,

 

I think it is just formatting which is confusing here..

 

the results can be (the start of your yellow highlighting):

  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • unclassified

if the customer in the tbl_customer doesn't have a result for that quarter, then it goes to an unclassified result.

 

the Total row should equal the count of customers. therefore the unclassified is the balancing figure:

 

Customers - Results in Quarter = unclassified results 

Hi @nightingale03,

1.PNG

Which means in your result matirx, you need have the 8 columns(0,1,2,3,4,5,6,unclassified)? How to judge if the customer in the tbl_customer doesn't have a result for that quarter, please give an example.

Best Regards,
Angelia

in SQL terms, if you perform a LEFT join on tblcustomer and tblresult (where quarter = 1 for example) and the result is:

 

Customer Name | Customer Number | Result | Result Date

Blue                    |  1                            |  NULL  | NULL

 

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.