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.
Hi All,
Did some researching on this but couldn't quite get the right answer. So figured I'd post this here.
Essentially I have year and sales data. (see below)
I want to create a new column, which for the years 2017-2035 just duplicates the sales data, but for the year 2016 I want to take a percentage of the 2016 sales data based on a parameter the user can control. I will call this the inclusion portion of 2016. The parameter is number of days in 2016 to include "0-365" then divided by 365 to get a percentage.
I tried this with a table calculation however I read that parameters do not work within table calculations and kept getting no result for 2016. I used the below DAX formula and syntax. but this gave me no result.
See below for my result
Any ideas how I would perform this calculation with a measure?
Please let me know if there is other data necessary to show to answer this question.
Regards
Solved! Go to Solution.
You should just have to wrap your [Year] portion in an aggregation like MAX to make that a measure as well as wrapping any other reference to a column in some type of aggregation like SUM or MAX depending on what you are trying to do.
@jdciaravino,
It seems that you are creating a calculated column rather than measure. Right click your table and select "New Measure", then apply the following DAX.
Measure = IF(MAX('SA SWS'[Year])=2016,MAX('SA SWS'[Sales])*'SA SWS'[Selectd Inclusion Value],MAX('SA SWS'[Sales]))
Regards,
Lydia
@jdciaravino,
It seems that you are creating a calculated column rather than measure. Right click your table and select "New Measure", then apply the following DAX.
Measure = IF(MAX('SA SWS'[Year])=2016,MAX('SA SWS'[Sales])*'SA SWS'[Selectd Inclusion Value],MAX('SA SWS'[Sales]))
Regards,
Lydia
You should just have to wrap your [Year] portion in an aggregation like MAX to make that a measure as well as wrapping any other reference to a column in some type of aggregation like SUM or MAX depending on what you are trying to do.
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 |
---|---|
107 | |
98 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |