Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have tried this a number of ways.
I have a All Months Case Summary Table. I need to get a count of the # of cases (by counting the participant ID column).
Case Owner Participant ID Date
A 1234 January
B 5467 January
C 8910 January
A 1234 February
B 5467 February
C 8910 February
I have AP Summary Table. I need to take the # of APs overdue and divide it by the # of cases from the All Months table.
Case Owner #APs Overdue Date
A 40 January
B 20 January
C 25 January
A 41 February
B 25 February
C 26 February
I have two tables that complete the counts of the cases and the counts of Overdue APs for me
@Khushidesai0109 @v-linyulu-msft Any further thoughts on this? I still haven't found a solution. Thanks!
Here's the final solution based on your requirements:
DAX
TotalCases =
CALCULATE(
COUNTROWS('All Months Case Details'),
ALLEXCEPT('All Months Case Details', 'All Months Case Details'[Case Owner], 'All Months Case Details'[Date])
)
DAX
TotalOverdueAPs =
CALCULATE(
SUM('AP Summary'[#APs Overdue]),
ALLEXCEPT('AP Summary', 'AP Summary'[Case Owner], 'AP Summary'[Date])
)
DAX
PercentageOverdueAPs =
DIVIDE(
[TotalOverdueAPs],
[TotalCases],
0
)
These measures should give you the correct percentage of overdue APs for each Case Owner, considering the total number of cases for each Case Owner and Month. You can then use these measures in your visualizations, applying filters for the desired month as needed.
Make sure your relationships between the tables are correctly set up to enable accurate filtering and aggregation based on the filters applied to your visuals.
If this post helps, please consider Accept as the solution to help the other members find it more quickly.
Give thumbs up as well!!
Thank You!!!
@Khushidesai0109 The first two calculations achieved the same output as my SUMMARIZE functions so the counts are correct. However, the DIVIDE function is still not producing the right % by Case Owner.
And for Case Owners that don't have a row in that month for the OverAP table a % isn't generated, but rather the # Total # of OverAPs is listed for them instead. This is the output for the first few Case Owners when I add PercentageOverdueAPs and Case Owner as fields to a Table visual without Months:
Case Owner A has 301 APs overdue total and 1215 cases = 24.7%
Case Owner B has 0 APs overdue total and 1 case = 0%
Case Owner C has 709 APs overdue total and 1191 cases = 59.5%
PercentageOverdueAPs Case Owner
11.76 A
14,290.00 B
12.00 C
(14290 is the total # APs overdue)
If I add in the date it just lists the same amount for every month.
These are the relationships.
Hi,@JJL_Ptbo
First of all, in my understanding your requirement is to count case totals by Participant ID in Table 1, then count the combined number of people belonging to them in Table 2, and divide the two numbers to get the percentage. I think the reason why you have added the filter, the percent value is not correct is that you count the number of rows is not divided by the person who belongs to it, but you added the filter, he will only sift the data, you count is still the total of the whole table. If my understanding is wrong, please give me your relative opinion:
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.To meet your needs, my measure are as follows:
Percentage divided =
VAR countbyowener=CALCULATE(COUNTROWS('All Months Case Details'),FILTER(ALLSELECTED('All Months Case Details'),'All Months Case Details'[Participant ID]=MAX('All Months Case Details'[Participant ID])))
VAR conuntbyap=CALCULATE(COUNTROWS('AP Summary'),FILTER(ALLSELECTED('AP Summary'),'AP Summary'[Case Owner]=MAX('AP Summary'[Case Owner])))
RETURN
DIVIDE(countbyowener,conuntbyap,0)
3.You can also modify the percentages if you wish to implement them as I have shown below:
4.Here's my final result, which I hope meets your requirements.
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
And I should say Participant ID is a text field.
@v-linyulu-msft This gets me closer, but it still isn't producing the correct %.
The # of Cases isn't by Participant ID the Participant ID represents the Case. And an AP is a requirement to have completed with a case and this metric is given as a total by that Case Owner in the table as opposed to by Participant/Case. I don't see an option to attach files, but this is sample in Power BI. In my real file there is a date table and an employee table the Case Owner field is Table 1 and 2 have relationships to the Employee table and Table 1 and 2 have relationships to the Date table.
All Months Case Details
AP Summary
Top Chart counting the # of cases with filters for Month and Case Owner. Bottom chart displaying # of APs overdue by Case Owner in December. The % of APs overdue for Case Owner A out of their total # cases in December should then be 50%.
User | Count |
---|---|
98 | |
90 | |
84 | |
70 | |
67 |
User | Count |
---|---|
115 | |
104 | |
101 | |
72 | |
64 |