Forum Discussion

Manasi25's avatar
Manasi25
Helper II
1 year ago
Solved

Sort data by day

The query is - I have 5 alerts in a day, which should be consider as 1, this alert is reporting daily and i want to count only 1 instead of 5 per day. As per below on date 02/01/2025 I want alert of"A" considered as only 1 and remove duplicates from same col. Same on date 02/02/2025 alert of "A" should be considered count only 1 and remove duplicates. How can this be done ?
Number Alert          Date
1              A          02/01/2025
2              A          02/01/2025
3              A          02/01/2025

4              A          02/01/2025
5              B           02/01/2025
6              B           02/01/2025
7              B           02/01/2025
8              A          02/02/2025
9             A           02/02/2025

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Manasi25 ,

     

    Refer to the steps below. In PowerQuery, first sort by the number column, and then select the Alert column and Date column to remove duplicates.

    Best Regards,
    Gao

    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

  • Hi Manasi25 

     

    You could select the 3 columns and click Home>Remove Rows > Remove duplicates. This will allow you to remove the duplicates and count as 1 for similar alerts.

     

    Hope this helps. Do give a kudos if it works! 

     

  • Manasi25 Create a new table that summarizes the data by "Alert" and "Date":

     

    DAX
    SummaryTable =
    SUMMARIZE(
        'YourTable',
        'YourTable'[Date],
        'YourTable'[Alert],
        "AlertCount", COUNTROWS('YourTable')
    )
    • Manasi25's avatar
      Manasi25
      Helper II

      I created table with only on column. and its giving me below error.

       

      • bhanu_gautam's avatar
        bhanu_gautam
        Super User
        SummaryTable =
        SUMMARIZE(
            'Table',
            'Table'[Date],
            'Table'[Alert],
            "AlertCount", COUNTROWS('Table')
        )
         
        Please find the PBIX with solution
  • Manasi25 Try creating a new table as below:

     

    NewTable = SUMMARIZE('Table','Table'[Alert],'Table'[Date],"Count of Alert", DISTINCTCOUNT('Table'[Alert]))