Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hello,
I have a table with columns Sale_Date and Post_Date. I need to calculate the business days between Sale_Date and Post_Date.
I have a caculated column to calculate the business days, but I need to convert it to M so that I can create a column inPower Query.
CountofBusinessdays = COUNTX ( Calendar, Calendar[Date] > 'Table'[Sale_Date]
&& Calendar, Calendar[Date] <= 'Table'[Post_Date]
&& Calendar[IsBusinessday] = 1 ) ,
Calendar[Date] )
How to convert the abow DAX to M?
Thank you so much!
Hi , @Harry_Tran
According to your description, you wan to convert the dax to M code.
This is my test data:
We can click "Custom Column" in the 'Table' and enter this:
Table.RowCount(Table.SelectRows(Calendar,(x)=>x[Date]>=[Sale_Date] and x[Date]<=[Post_Date] and x[IsBusinessday]=1))
Then we can get the result:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.