The M code can be tricky to get your head around but it sure can often reduce the amount of steps needed to achieve your goal vs using the User Interface buttons.
Download the file here
https://aasolutions.sharepoint.com/:f:/s/PubliclyAvailableContent/EkpLzHrrogtAoAlErGpZW_gBtrzMQdlzI8ggKg-ykWZwWw?e=nEF7rN
Prior Video Solution using button clicks
https://youtu.be/e9y4hOFQPgc
The team and I at Access Analytic develop Power BI and Excel solutions for clients in Australia and deliver training around the World. https://accessanalytic.com.au/
Did you know I've written a book "Power BI for the Excel Analyst"?
https://pbi.guide/book/
Connect with me
https://wyn.bio.link/