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.
Hello everyone!!!
I am working on a table to calculate sales.
The table has date and item sold columns
I am looking forward to multiply the "item sold" column with 2 if the date is before April 2020 and multiply "item sold" with 1.5 for April 2020 onwards
I tried using IF such that IF Month and Year = January 2020/February 2020/March 2020 times by 2, but I couldn't use my "date" column in my IF calculation. Is there any way to solve this?
Thank you!
Solved! Go to Solution.
@Anonymous , You are trying a measure I suggested a column
Column =
if(Table[Date] <=date(2020,04,30) ,[Item sold] *2, [item sold]*1.5)
measure =
if(max(Table[Date]) <=date(2020,04,30) ,Sum(Table[Item sold]) *2, Sum(Table[item sold])*1.5)
day need to be in row context
or try like
Sumx(values(Table[date]),if(max(Table[Date]) <=date(2020,04,30) ,Sum(Table[Item sold]) *2, Sum(Table[item sold])*1.5))
@Anonymous , if there is Date tray to use it like this . Create a new column
if(Table[Date] <=date(2020,04,30) ,[Item sold] *2, [item sold]*1.5)
Dear @amitchandak ,
I tried using this solution but I couldnt use the Date column in my IF statement (picture attached below). This is what I'm trying to solve
I
Thank you!
Sara
@Anonymous , You are trying a measure I suggested a column
Column =
if(Table[Date] <=date(2020,04,30) ,[Item sold] *2, [item sold]*1.5)
measure =
if(max(Table[Date]) <=date(2020,04,30) ,Sum(Table[Item sold]) *2, Sum(Table[item sold])*1.5)
day need to be in row context
or try like
Sumx(values(Table[date]),if(max(Table[Date]) <=date(2020,04,30) ,Sum(Table[Item sold]) *2, Sum(Table[item sold])*1.5))
Thankyou! The max one works and give me the result that I want
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
110 | |
91 | |
84 | |
66 |