Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext 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
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:
| date | user_id | banner_name |
| 10/01/2023 | u1 | bname1 |
| 10/01/2023 | u1 | bname2 |
| 10/01/2023 | u2 | bname2 |
| 10/01/2023 | u3 | bname1 |
| 10/01/2023 | u3 | bname3 |
I can turn this table into something like this
| date | user_id | number_of_clicks |
| 10/01/2023 | u1 | 2 |
| 10/01/2023 | u2 | 1 |
| 10/01/2023 | u3 | 2 |
What I want is a table which tells me for each day how many users click on one banner, how many click on two, ...
| date | number_of_clicks | number_of_users |
| 10/01/2023 | 1 | 1 |
| 10/01/2023 | 2 | 2 |
| 10/01/2023 | 3 | ... |
Could you please help me?
Solved! Go to Solution.
@FabMann , I think you need dynamic segmentation
refer
Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ
Hi,
You may download my PBI file from here.
Hope this helps.
Hi @FabMann ,
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
@FabMann , I think you need dynamic segmentation
refer
Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 45 | |
| 44 | |
| 20 | |
| 19 |
| User | Count |
|---|---|
| 73 | |
| 71 | |
| 34 | |
| 33 | |
| 31 |