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, I have a table with all sales from the previous 3 years with the date of the sale, the store number and more. I needed a measure that compared the sales of 2020 to the sales of 2019 so I did measure = (sales of 2020 - sales of 2019) / sales of 2019. This measure works fine in a table separated by the store number however when I want to graph it by month, the bar chart doesn't work and I believe it is because in my measure there are 2 dates: the date of the sale in 2019 and the date of the sale in 2020.
I want my bar chart to have the date of sale in 2020 (just the month) on the x axis and the values to be (sale of Jan2020 - sales of year2019) / sales of year 2019 and so on for Feb, march.... Any ideas? (I dont want (jan2020 - jan2019)/jan2019)
Thank you
@Anonymous
Not sure how is your model looks like, but you should have 1 date column only, something like.
Date | Sales |
2019.1.1 | 1000 |
2019.1.2 | 2000 |
2019.1.3 | 2000 |
.... | ... |
2020.1.1 | ... |
2020.1.2 | ... |
... | .. |
Then, you can aggregate or compare sales with some dax using measures.
Please provide a sample pbix or sample table that can describes your model.
Best regards
Paul Zheng _ Community Support Team
It sounds like you have a model issue. You should have one date column for sales, not one for 2019 and 2020. You will need to post some data so we can help. If you post a PBIX file, which is generally good, make sure to include the source data somehow - in Excel for example. I am thinking some of your columns need to be unpivoted so the dates can be put in a single column.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCovering 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 |
---|---|
106 | |
94 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |