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.
I currently have a Date table populated with:
* FullDate (date)
* MonthBeginDate (date)
* MonthEndDate (date)
* IsBusinessDay (String "Y" or "N")
I am trying to add 3 columns in DAX (or in the query builder, but I doubt that is possible):
* BusinessDaysForMonth
* BusinessDaysPassedForMonth
* PercentBusinessDaysPassedForMonth
any help would be much appreciated
Solved! Go to Solution.
Hey,
thanks for taking the time to prepare the pbix file. I'm not able to recreate the calculated columns I posted in my initial answer - this is so weird.
Nevertheless - here you will find a working solution where the DAX statement of the calculated columns is slightly adjusted:
Business Days passed = var currentDate = 'Calendar'[Date] var firstdayofmonth = EOMONTH(currentDate, -1)+1 var daterange = DATESBETWEEN('Calendar'[Date], firstdayofmonth, currentDate) return //countrows(daterange) CALCULATE( SUM('Calendar'[Is Business Day]) ,All('Calendar') ,daterange )
and
Business Days per Month = var currentDate = 'Calendar'[Date] var firstdayofmonth = EOMONTH(currentDate, -1)+1 var lastdayofmonth = EOMONTH(currentDate, 0) var daterange = DATESBETWEEN('Calendar'[Date], firstdayofmonth, lastdayofmonth) return CALCULATE( SUM('Calendar'[Is Business Day]) ,All('Calendar') ,daterange )
Thanks for your patience and pointing me to an issue in my solution
Regards
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 |
---|---|
111 | |
94 | |
83 | |
67 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |