Forum Discussion
Help with something super simple
- 8 years ago
Hi Anonymous,
For example in excel, it is a simple =SUMIF(B:B,"2017",D:D). Give me the sum of column D, but only if Column b contains the data for 2017.The formula below to create a measure is for your reference. :smileyhappy:
Sales 2017 = CALCULATE(SUM('Table1'[Value]),FILTER('Table1','Table1'[Year]=2017))Note: You'll need to replace 'Table1' with your real table name.
Regards
Anonymous
Just Pivot your YEAR column using Value column as VALUES
Then you can add the VARIANCE and VAR% columns easily
You can unpivot back as well
You will get
- Anonymous8 years agoNot applicable
I dont understand how that works.
I am assuming I have to:
create a measure that calculates the total sales for 2016, I cant get it to only sum the sales of 2016.
same thing for 2017.
The i can create the varaince.
I dont understand how to do the steps above.
- Zubair_Muhammad8 years agoCommunity Champion
Anonymous
This is done through QUERY Editor or Power Query
Right click the TABLE and select Edit Query
- Anonymous8 years agoNot applicable
That is not helpful at all. Can anyone please show me how to write a dax forumal that sums up a column, but only if another column contains a certain data point. For example in excel, it is a simple =SUMIF(B:B,"2017",D:D). Give me the sum of column D, but only if Column b contains the data for 2017.