Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sverderame
Helper I
Helper I

I am trying to perform a simple ITTT statement as a new measure

I'd like to create a new measure that will calculate all the data from a column row of a table based on 1 criteria.

 

if (Harvest_Year) = 2019 then "2018 carryover" else 0

 

keep getting minumium argument for If function is 2

7 REPLIES 7
TomMartens
Super User
Super User

Hey,

 

if you are creating the "custom" column inside the Power Query than the syntax has to be

if [Harvest_Year] = 2019 then "2018 carryover" else 0

if use DAX to create a "calculated column" maybe this will provide additional information:

https://docs.microsoft.com/en-us/dax/if-function-dax

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thanks for the reponse. This is what I am trying to do in with DAX

 

Measure 4 = if(all(Project_Table[Harvest Year]="2019",Project_Table[2018 Carry Over],Project_Table[2018 Carry Over]="0"))

 

I am trying to caluclate the column 2018 Carryover only if the year 2019 is selected

Hi @sverderame,

 

It could be this one below. If not, please provide a sample without sensitive data.

 

Measure 4 =
IF (
    SELECTEDVALUE ( Project_Table[Harvest Year] ) = 2019,
    Project_Table[2018 Carry Over],
    0
)

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

For some reason I can't get these suggestions to work. I want to select year "2019" (row 3) using a slicer filter and bring back the value "20" in (row 2) year "2018"

2019-03-09_17-20-25.png

Hi,

 

If there isn't already, create a Date column (from seperate Year and Month columns) in the base data table.  Create a Calendar Table with running dates.  Build a relationship from the Date column of your base data table to the Date column of your Calendar Table.  In the Calendar Table, extract the Year in another column Year=Year(Calendar[Date]).  In your slicer visual, drag the Year from the Calendar table and select 2019.  Write these measure and drag the second one to your card visual

 

Total savings = SUM(Data[Savings])

Total savings in the previous year = CALCULATE([Total Savings],PREVIOUSYEAR(Calendar[Date]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you very much!
Anonymous
Not applicable

=IF(Harvest_Year=2019;"2018 carryover";0)

but man, this is a simple syntax error, look it up on documentation.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.