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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.