Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi guys,
I am looking to create a field to show order reserve for the future on each date.
I have got it working by using filters in dax but that does not give me the possibility show it added to a range of dates.
Here is a data sample. I have the first two columns and need to create the third one. I want to mention that the only thing I can use is DAX as the dataset is locked and I cant edit anything.
// Calendar joins on Date to Orders[Date]
// and is the date table in the model
// marked as such.
[Order Count] = COUNTROWS( Orders )
[Orders Reserve] =
var __firstDateInContext = FIRSTDATE( 'Calendar'[Date] )
// Get the total count of orders
// from the first date to the end.
var __result =
CALCULATE(
[Order Count],
// For this to work, 'Calendar' must be
// marked as the Date table in the model
// and has to be a proper date table!
'Calendar'[Date] >= __firstDateInContext
)
return
__result
Best
D
@Anonymous Hi. Thanks for your reply.
I am getting the following error using this formula:
"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value".
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |