Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Manasi25
Helper II
Helper II

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

1 ACCEPTED SOLUTION
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.

2025-02-20_09-29-20.gif

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

View solution in original post

9 REPLIES 9
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.

2025-02-20_09-29-20.gif

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

Tahreem24
Super User
Super User

@Manasi25 Try creating a new table as below:

 

NewTable = SUMMARIZE('Table','Table'[Alert],'Table'[Date],"Count of Alert", DISTINCTCOUNT('Table'[Alert]))
 
Tahreem24_0-1739951259822.png

 

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
bhanu_gautam
Super User
Super User

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

 

DAX
SummaryTable =
SUMMARIZE(
    'YourTable',
    'YourTable'[Date],
    'YourTable'[Alert],
    "AlertCount", COUNTROWS('YourTable')
)



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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

Manasi25_0-1739950138326.png

 

SummaryTable =
SUMMARIZE(
    'Table',
    'Table'[Date],
    'Table'[Alert],
    "AlertCount", COUNTROWS('Table')
)
 
Please find the PBIX with solution



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Okay, thats fine, what if I want to remove all duplicates and keep row of the alert which alerted first by date and time.


@Manasi25 

Add a calculated column to rank the alerts by date and time:
AlertRank =
RANKX(
FILTER(
'YourTable',
'YourTable'[Date] = EARLIER('YourTable'[Date]) &&
'YourTable'[Alert] = EARLIER('YourTable'[Alert])
),
'YourTable'[Time], // Assuming you have a 'Time' column
,

Create a new table that keeps only the first occurrence of each alert per day:
FirstAlertTable =
FILTER(
'YourTable',
'YourTable'[AlertRank] = 1
)
This approach uses the RANKX function to rank the alerts by date and time, and then filters the table to keep only the first occurrence of each alert per day. If you do not have a time column, you can rank by the date alone.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






It doesn't make any difference with my actual data. I want to keep row from "Alert" col by day.


Want to remove duplicates. Keep the only one alert which has 5 duplicates entry in a day. Same for another could happen, but want entry only 1 for each day.

SamanthaPuaXY
Helper II
Helper II

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.

SamanthaPuaXY_0-1739948923094.png

 

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

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.