Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi!
I want to create an IF formula so that it filters based on a particular fiscal year. Also I want depending on the Fiscal Year a particular SUM on a table is triggered.
This is the formula that I'm using (that doesn't work 😞 😞
Solved! Go to Solution.
@fernandoC Oh, sorry, missed that in the formula, was so focused on the other issue, you probably want:
IF('Fiscal Year Calendar'[Fiscal Year] = "FY19-20",CALCULATE(SUM('Training Costs'[# of Employees])))
or:
IF(MAX('Fiscal Year Calendar'[Fiscal Year]) = "FY19-20",CALCULATE(SUM('Training Costs'[# of Employees])))
ISFILTERED returns true/false if the column is filtered or not. So, you can't compare that to a text value. That is what it was complaining about. Use the second version if this is a measure.
@fernandoC First, I think you want:
Training Hours Test = IF(ISFILTERED('Fiscal Year Calendar'[Fiscal Year]) = "FY19-20",CALCULATE(SUM('Chisinau 2 FY1920'[# of Employees]),SUM('Chisinau 2 FY2021'[# of Employees]) ))
Hi @Greg_Deckler,
Thank you for your quick response.
I've made some changes to both tables and appended them altogether as I needed it for other calculations. Based on your formula I changed it to:
@fernandoC Oh, sorry, missed that in the formula, was so focused on the other issue, you probably want:
IF('Fiscal Year Calendar'[Fiscal Year] = "FY19-20",CALCULATE(SUM('Training Costs'[# of Employees])))
or:
IF(MAX('Fiscal Year Calendar'[Fiscal Year]) = "FY19-20",CALCULATE(SUM('Training Costs'[# of Employees])))
ISFILTERED returns true/false if the column is filtered or not. So, you can't compare that to a text value. That is what it was complaining about. Use the second version if this is a measure.
Thanks Greg! it works.
For some reason the tables were not attached on my original comment:
User | Count |
---|---|
84 | |
76 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |