Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi folks,
I have a table like "BEFORE", it has the date record for every SITE, on any given month. Site can has several dates on the same month.
What you saw on "AFTER", is the count summarize from "BEFORE". As you can see, on any given month, any given site, we has Date column that is the count distinct of the dates.
How to make AFTER table in Power Query?
Thank you!
Solved! Go to Solution.
@akbjf , You can create aggregated in power query. There is Group by Option
https://radacad.com/power-bi-aggregation-step-1-create-the-aggregated-table
Summarize in DAX
Hi @akbjf
Given that example data this query will produce the output you've shown. It groups on the Calendar Month and Site and does a distinct count on date.
Here's an example PBIX file with the query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krMK00sqlTSUXIEYkN9Q30jAyMDpVgdTCkjbFJOYCkT3FKmuKXMoFKxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Calendar Month" = _t, Site = _t, Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Calendar Month", type text}, {"Site", type text}, {"Date", type date}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Calendar Month", "Site"}, {{"Date", each Table.RowCount(Table.Distinct(_)), Int64.Type}})
in
#"Grouped Rows"
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Hi @akbjf ,
Here are the steps you can follow:
1. Open Power Query
2. Select a column, right-click, and select group by
3. Select advanced and add two columns, Calendar and Site
4. Result.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @akbjf
Given that example data this query will produce the output you've shown. It groups on the Calendar Month and Site and does a distinct count on date.
Here's an example PBIX file with the query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krMK00sqlTSUXIEYkN9Q30jAyMDpVgdTCkjbFJOYCkT3FKmuKXMoFKxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Calendar Month" = _t, Site = _t, Date = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Calendar Month", type text}, {"Site", type text}, {"Date", type date}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Calendar Month", "Site"}, {{"Date", each Table.RowCount(Table.Distinct(_)), Int64.Type}})
in
#"Grouped Rows"
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
@akbjf , You can create aggregated in power query. There is Group by Option
https://radacad.com/power-bi-aggregation-step-1-create-the-aggregated-table
Summarize in DAX
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |