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,
I have a table - MemberJoin in Power BI which looks like below:
And I want to create an aggregated table from MemberJoin using M language. Is it doable? If yes, how to do it in M?
The corresponding SQL statement is below, and it's followed by a screenshot of what the new table should look like.
select [YTD Flag], [Member Type], year([Join Date]) "Year", MONTH([Join Date]) "Month", datename(MONTH, [Join Date]) "MonthName", [Join Channel], COUNT(*) "Count", cast(count([YTD Flag]) as float) / cast(sum(count([YTD Flag])) over (partition by year([Join Date])) as float) "Prcnt by Year" from [MemberJoin] group by [YTD Flag], [Member Type], [Join Channel], year([Join Date]), MONTH([Join Date]), datename(MONTH, [Join Date]) order by [YTD Flag] desc, [Member Type] desc, Year desc, Month, [Join Channel] ;
Solved! Go to Solution.
Hi @mochabits,
On the advance query you need to do a group by and select all the fields you want to keep in your table and then select the one that you want to count.
Check this link and view the part about group rows.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @mochabits,
On the advance query you need to do a group by and select all the fields you want to keep in your table and then select the one that you want to count.
Check this link and view the part about group rows.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 |
---|---|
113 | |
103 | |
76 | |
66 | |
63 |
User | Count |
---|---|
142 | |
105 | |
102 | |
81 | |
68 |