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
FabMann
Frequent Visitor

Count aggregated data

Hello, I am preatty sure this is simple but I'm blowing my mind.

I have a bunch of data which tell me each day which user click on a certain banner. 

So my table is something like:

dateuser_idbanner_name
10/01/2023u1bname1
10/01/2023u1bname2
10/01/2023u2bname2
10/01/2023u3bname1
10/01/2023u3bname3

 

I can turn this table into something like this

dateuser_idnumber_of_clicks
10/01/2023u12
10/01/2023u21
10/01/2023u32

 

What I want is a table which tells me for each day how many users click on one banner, how many click on two, ...

 

datenumber_of_clicksnumber_of_users
10/01/202311
10/01/202322
10/01/20233...

 

Could you please help me?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@FabMann , I think you need dynamic segmentation

refer

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @FabMann ,

 

vcgaomsft_0-1675221853165.png

vcgaomsft_1-1675221877528.png

Please create a new blank query in PowerQuery and paste the code below into the advanced editor.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjTQN9Q3MjAyVtJRKjUEEkl5ibmphkqxOrjkjDDljPDIGeMxEy5nDJMzwuMWLHJGeOSwmInpFixyQDNjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [date = _t, user_id = _t, banner_name = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"date", type date}, {"user_id", type text}, {"banner_name", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"date", "user_id"}, {{"number_of_clicks", each Table.RowCount(_), Int64.Type}}),
    #"Grouped Rows1" = Table.Group(#"Grouped Rows", {"date", "number_of_clicks"}, {{"number_of_users", each Table.RowCount(_), Int64.Type}}),
    #"Sorted Rows" = Table.Sort(#"Grouped Rows1",{{"date", Order.Ascending}, {"number_of_clicks", Order.Ascending}})
in
    #"Sorted Rows"

 

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

amitchandak
Super User
Super User

@FabMann , I think you need dynamic segmentation

refer

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.