Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I've been searching and searching but I can't seem to find the syntax for a measure that will allow me to count the number of Mondays within a date range. The date range will be selected through a slicer on the same page.
What is the DAX syntax in order to do this?
Thanks!
Solved! Go to Solution.
Hi @amulder,
Maybe this one? Please share a dummy sample file.
Measure = CALCULATE ( COUNT ( 'Date'[DOW), all('table'[HourBlock] ) )
Best Regards,
Dale
Hi guys,
I would like to get solution as below in Power BI :
You can use this MEASURE
Measure = VAR selected_dates = ADDCOLUMNS ( GENERATESERIES ( MIN ( Table1[Date] ), MAX ( Table1[Date] ) ), "Weekday", WEEKDAY ( [Value], 3 ) ) RETURN COUNTROWS ( FILTER ( selected_dates, [Weekday] = 0 ) )
If you want to know which dates are Monday
You can use this MEASURE
Measure 2 = VAR selected_dates = ADDCOLUMNS ( GENERATESERIES ( MIN ( Table1[Date] ), MAX ( Table1[Date] ) ), "Weekday", WEEKDAY ( [Value], 3 ) ) RETURN CONCATENATEX ( FILTER ( selected_dates, [Weekday] = 0 ), [Value], UNICHAR ( 10 ) )
Please see file attached as well
I need the day of the week to adjust automatically when I add it to my matrix but only be filtered by the column not the row. Right now I'm just using a simple COUNT('Date'[DOW) which works on its own, however in my matrix I have a column titled HourBlock that breaks my count of records (Number) down by hour. Since not every hour within the month filter has records the DOW_COUNT gets filtered accordingly. I don't want it to. I essentially want the values that I see in the small matrix beside the big one which has the official counts of the days of the week.
Hi @amulder,
Maybe this one? Please share a dummy sample file.
Measure = CALCULATE ( COUNT ( 'Date'[DOW), all('table'[HourBlock] ) )
Best Regards,
Dale
YES!!!!!! That was exactly what I needed! THANK YOU!!!!
Hi,
Could you share the solution to obtain the number of each day within a date range??
Thanks.
Please see file attached as well