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'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
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 |
---|---|
109 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |