Forum Discussion
Need help converting DAX to M code
- 3 years ago
Hi sandy2786 ,
According to your description, I create a sample. Based on the code you provided I create a calculated column and get the following result:
If you want to do it in M language, here's my solution. Create a custom column.
Table.RowCount(Table.SelectRows(#"Changed Type",(x)=>x[MonthnYear]=[MonthnYear]and x[Day of Week]=[Day of Week]))Get the same result:
In addition, if you just want to show the result in a visual, you can simply put Date column in the visual and select Count without other calculation.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dont use DAx for date logic, use calendar table.
Build a good calamndar tabnbel onace and use it always.
Click here to learn about Power Bi calendar tables
You can quickly do it like this
Click Modelling and New Table
Period =