We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 54 | |
| 39 | |
| 32 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 64 | |
| 63 | |
| 37 | |
| 36 | |
| 22 |