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 All,
I would like to ask your help to create a calendar column (BeforeActualYearMonth) based on the following criteria:
If the Calendar[YearMonth] < LoadedAt[YearMonth] then Calendar[BeforeActualYearMonth] = "BeforeActual" else Calendar[BeforeActualYearMonth] = Calendar[YearMonth] in each row in Calendar table.
Please, see the attached file for more details:
PS: It is neccessary to calculate start balance of all material quanity in running total calculation.
Thank you very much in advance!
Solved! Go to Solution.
BeforeActualYearMonth =
var CalendarYearMonth = Calendar[YearMonth]
// There must be just one value in LoadedAt
var LoadedAtYearMonth = SELECTEDVALUE( LoadedAt[YearMonth] )
return
if ( CalendarYearMonth < LoadedAtYearMonth,
"BeforeActual",
// CalendarYearMonth must be turned into
// a string since you can't mix types
// in a column. If it's already text,
// you can just use the raw value without >& ""<.
CalendarYearMonth & ""
)
BeforeActualYearMonth =
var CalendarYearMonth = Calendar[YearMonth]
// There must be just one value in LoadedAt
var LoadedAtYearMonth = SELECTEDVALUE( LoadedAt[YearMonth] )
return
if ( CalendarYearMonth < LoadedAtYearMonth,
"BeforeActual",
// CalendarYearMonth must be turned into
// a string since you can't mix types
// in a column. If it's already text,
// you can just use the raw value without >& ""<.
CalendarYearMonth & ""
)
This is what I want, thank you @Anonymous!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |