Forum Discussion

ajitk15's avatar
ajitk15
Regular Visitor
2 years ago

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!

 

Fail TX % = DIVIDE( sum(Transactions[Error Transactions]), SUM(Transactions[Total Transactions]))
Fail TX % > 10% = IF([Fail TX %] > 0.1, 1, 0)
 

below is the sample data.

 

Tranaction DateTransaction TypeTotal TransactionsError Transactions
Friday, April 5, 2024Purchase50010
Friday, April 5, 2024Withdrawal30060
Friday, April 5, 2024Transfer2008
Friday, April 5, 2024Payment70015
Friday, April 5, 2024Refund15040
Friday, April 5, 2024Deposit40012
Friday, April 5, 2024Invoice25050
Friday, April 5, 2024Credit60018
Friday, April 5, 2024Debit3509
Friday, April 5, 2024Expense45011
Friday, April 5, 2024Revenue80020
Friday, April 5, 2024Salary2005
Friday, April 5, 2024Bonus1504
Friday, April 5, 2024Interest30060
Friday, April 5, 2024Dividend10040
Friday, April 5, 2024Loan501
Thursday, April 4, 2024Purchase60015
Thursday, April 4, 2024Refund1003
Thursday, April 4, 2024Purchase50010
Thursday, April 4, 2024Withdrawal3005
Thursday, April 4, 2024Transfer20070
Thursday, April 4, 2024Payment70015
Thursday, April 4, 2024Refund15040
Thursday, April 4, 2024Deposit40012
Thursday, April 4, 2024Invoice25050
Thursday, April 4, 2024Credit60018
Thursday, April 4, 2024Debit3509
Thursday, April 4, 2024Expense45011
Thursday, April 4, 2024Revenue80020
Thursday, April 4, 2024Salary2005
Thursday, April 4, 2024Bonus1504
Thursday, April 4, 2024Interest30060
Thursday, April 4, 2024Dividend10040
Thursday, April 4, 2024Loan501
Thursday, April 4, 2024Withdrawal2005
Thursday, April 4, 2024Purchase60015
Thursday, April 4, 2024Refund1003
Monday, March 4, 2024Purchase50010
Monday, March 4, 2024Withdrawal3005
Monday, March 4, 2024Transfer2008
Monday, March 4, 2024Payment70015
Monday, March 4, 2024Refund15040
Monday, March 4, 2024Deposit40012
Monday, March 4, 2024Invoice25050
Monday, March 4, 2024Credit60018
Monday, March 4, 2024Debit3509
Monday, March 4, 2024Expense45011
Monday, March 4, 2024Revenue800100
Monday, March 4, 2024Salary2005
Monday, March 4, 2024Interest30060
Monday, March 4, 2024Loan5012
Monday, March 4, 2024Withdrawal2005
Monday, March 4, 2024Purchase60015
Monday, March 4, 2024Refund1003

2 Replies

  • Anonymous's avatar
    Anonymous
    Not 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 Team

     

    If 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

    • ajitk15's avatar
      ajitk15
      Regular 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