Forum Discussion
Anonymous
7 years agoNot applicable
Trying to automate dates using two different data sources
Hello! I am fairly new to the developing side of Power BI and stuck on trying to figure out a way to automate the Fiscal Periods on a new Sales Forecasting report. The actual sales d...
Anonymous
7 years agoNot applicable
I did that a couple of times and kept getting errors but finally got it to error out with the code below :)
Var Month =
VAR MinMonth = 'Current Fiscal Dates'[Current (FY Period)]
VAR MaxMonth = [FY Period (2 Months Ago)]
RETURN
IF('Current Fiscal Dates'[Current (FY Period)] >= MinMonth && 'Current Fiscal Dates'[FY Period (2 Months Ago)] <= MaxMonth, 1, blank())
So now, I just use this as a filter and it will only return those dates?
deepu299
7 years agoAdvocate V
Right, my expectation is the value of "Var Month" will be 1 only for the records in those 3 months in the whole dataset and it should be Blank for other rows. Do test it from your side and add the filter as needed. You can hide it from the filter pane so it's not visible to users.