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 am creating a visual for a Direct Query. I need to return the LastDate from my Date Dimension table (Rolling Calendar) and pass that into my CALCULATE Function to sum the TotalDrawers for that date. I keep getting a locking error. When I check it in DAXStudio it indicated there is an issue with LASTDATE. Seems that this has to do with the LASTDATE being used in a CALCULATE function on a Direct Query. Any thoughts on how to resolve the issue?
@shippen70 , Try like
WTDDrawers =
VAR SelectDate =
maxx(allselected('Rolling Calendar'), 'Rolling Calendar'[Calendar Date] )
VAR DayNumberOfWeek =
WEEKDAY ( SelectDate, 1 )
//VAR TestFirstDate = DATEADD ( SelectDate, ( -1 * DayNumberOfWeek ) + 1, DAY )
RETURN
CALCULATE (
SUM ( _AE1WeekComp[TotalDrawers] ),
DATESBETWEEN (
'Rolling Calendar'[Calendar Date],
DATEADD ( SelectDate, ( -1 * DayNumberOfWeek ), DAY ),
SelectDate
)
)
I did no check formula logic
For week refer
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
In case you can not add more column to date table in the database have one in power BI
Hi @shippen70
Try MAX( 'Rolling Calendar'[Calendar Date] )
I tried using MAX but then I get the error that is needs a Column Reference.
Hi @shippen70
Is this happening when using MAX( _ ) on its own or only as part of your synatx?
Alone
MAX( 'Rolling Calendar'[Calendar Date] )
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 |
---|---|
45 | |
26 | |
22 | |
13 | |
8 |
User | Count |
---|---|
73 | |
51 | |
45 | |
16 | |
12 |