Reputation: 73
I am working to create a measure in Power BI that will allow me to track whether each quarter in the fiscal year is in work or complete.
Right now, I have a measures that calculate:
Fiscal Quarter of each month in my table (My fiscal year is 10/1-9/31)
Quarters = if(Month([Date]) >= 10, "Q1", if(Month([Date]) <= 3, "Q2",
if(Month([Date]) <= 6, "Q3", "Q4")))
Current Fiscal Quarter
current Quarter = if(Month(TODAY()) >= 10, "Q1", if(Month(TODAY()) < 4, "Q2",
if(Month(TODAY()) < 7, "Q3", "Q4")))
Current Month
Current Month = MONTH(TODAY())
I want a calculated column or measure that does the following:
Basically, if a quarter is still in progress, the measure should display Q_ - Estimate
, and if the quarter is complete or has not yet begun, it should display Q_ - Actual
So for example, we are in quarter 4 right now, so the measure should display Q4 - Estimate
for Q4, and Q1 - Actual
, Q2 - Actual
, and Q3 - Actual
since Q1-Q3 are complete.
The end goal is to have these labels on the x-axis for the following graph:
I have attempted some IF statements, but keep getting stuck since each quarter must assume one of two values.
I want the following:
IF([current quarter] = "Q4", "Q4 - Estimate", "Q4 - Actual")
... but for every quarter.
Is it possible to accomplish this in one IF statement? If not, how might I tackle this?
Thank you for your help.
Upvotes: 1
Views: 1175
Reputation: 2968
How about this:
[column] = IF([Quarters]=[current quarter],[Quarters] & " - estimate",[Quarters] & " - Actual")
Upvotes: 1