Forum Discussion
DAX count group by week
I have below requirement to generate count number of transaction error count greater than 10% in a week, after trying couple of weeks seeking help here, attached mockup data, pbix as well, Appreciate for any help and thanks in advance!
below is the sample data.
| Tranaction Date | Transaction Type | Total Transactions | Error Transactions |
| Friday, April 5, 2024 | Purchase | 500 | 10 |
| Friday, April 5, 2024 | Withdrawal | 300 | 60 |
| Friday, April 5, 2024 | Transfer | 200 | 8 |
| Friday, April 5, 2024 | Payment | 700 | 15 |
| Friday, April 5, 2024 | Refund | 150 | 40 |
| Friday, April 5, 2024 | Deposit | 400 | 12 |
| Friday, April 5, 2024 | Invoice | 250 | 50 |
| Friday, April 5, 2024 | Credit | 600 | 18 |
| Friday, April 5, 2024 | Debit | 350 | 9 |
| Friday, April 5, 2024 | Expense | 450 | 11 |
| Friday, April 5, 2024 | Revenue | 800 | 20 |
| Friday, April 5, 2024 | Salary | 200 | 5 |
| Friday, April 5, 2024 | Bonus | 150 | 4 |
| Friday, April 5, 2024 | Interest | 300 | 60 |
| Friday, April 5, 2024 | Dividend | 100 | 40 |
| Friday, April 5, 2024 | Loan | 50 | 1 |
| Thursday, April 4, 2024 | Purchase | 600 | 15 |
| Thursday, April 4, 2024 | Refund | 100 | 3 |
| Thursday, April 4, 2024 | Purchase | 500 | 10 |
| Thursday, April 4, 2024 | Withdrawal | 300 | 5 |
| Thursday, April 4, 2024 | Transfer | 200 | 70 |
| Thursday, April 4, 2024 | Payment | 700 | 15 |
| Thursday, April 4, 2024 | Refund | 150 | 40 |
| Thursday, April 4, 2024 | Deposit | 400 | 12 |
| Thursday, April 4, 2024 | Invoice | 250 | 50 |
| Thursday, April 4, 2024 | Credit | 600 | 18 |
| Thursday, April 4, 2024 | Debit | 350 | 9 |
| Thursday, April 4, 2024 | Expense | 450 | 11 |
| Thursday, April 4, 2024 | Revenue | 800 | 20 |
| Thursday, April 4, 2024 | Salary | 200 | 5 |
| Thursday, April 4, 2024 | Bonus | 150 | 4 |
| Thursday, April 4, 2024 | Interest | 300 | 60 |
| Thursday, April 4, 2024 | Dividend | 100 | 40 |
| Thursday, April 4, 2024 | Loan | 50 | 1 |
| Thursday, April 4, 2024 | Withdrawal | 200 | 5 |
| Thursday, April 4, 2024 | Purchase | 600 | 15 |
| Thursday, April 4, 2024 | Refund | 100 | 3 |
| Monday, March 4, 2024 | Purchase | 500 | 10 |
| Monday, March 4, 2024 | Withdrawal | 300 | 5 |
| Monday, March 4, 2024 | Transfer | 200 | 8 |
| Monday, March 4, 2024 | Payment | 700 | 15 |
| Monday, March 4, 2024 | Refund | 150 | 40 |
| Monday, March 4, 2024 | Deposit | 400 | 12 |
| Monday, March 4, 2024 | Invoice | 250 | 50 |
| Monday, March 4, 2024 | Credit | 600 | 18 |
| Monday, March 4, 2024 | Debit | 350 | 9 |
| Monday, March 4, 2024 | Expense | 450 | 11 |
| Monday, March 4, 2024 | Revenue | 800 | 100 |
| Monday, March 4, 2024 | Salary | 200 | 5 |
| Monday, March 4, 2024 | Interest | 300 | 60 |
| Monday, March 4, 2024 | Loan | 50 | 12 |
| Monday, March 4, 2024 | Withdrawal | 200 | 5 |
| Monday, March 4, 2024 | Purchase | 600 | 15 |
| Monday, March 4, 2024 | Refund | 100 | 3 |
2 Replies
- AnonymousNot applicable
Hi, ajitk15
Based on your description, I have created some measures to achieve the effect you are looking for. Following picture shows the effect of the display.
Measure:Counts Fail TX% > 10% = CALCULATE ( COUNTROWS ( Transactions ), FILTER ( Transactions, [Fail TX % > 10%] = 1 ) )Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
- ajitk15Regular Visitor
Hi Anonymous , Thanks for your response, as i have group by week still it's calculting number of occurraces. count Fail T% > 10% should always be 1 then should count, have drill
Link to my file Public_Powerbi