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.
I have a data table that has transactions for a retail business. I am wanting to make a line chart which has each year as a separate line, and then the month/day as the horizontal axis with quantity sold as the vertical axis. Ultimately I would like the line to be a running total as of the date on the horizontal axis the quantity sold year to date.
The first problem I am having is with getting just the month-day. I was able to separate out the year from the 'SaleDay' but any time I try to just get the month-day separate I keep getting errors. I am using DirectQuery to an sql database so as the database updates the chart will update as well. So some solutions I have found on the forum have not worked because it says it is not supported by directquery.
If anyone has a suggestion for also get a running total (the quick measure way didn't work for me, maybe I did wrong fields) I would be very appreciative.
Solved! Go to Solution.
Do You have predefined values for years? If so, you can create a measure for given years current total and place them on your chart.
A measure definition could be like that:
2016 = CALCULATE ( [your measure], FILTER ( ALL ( Table[SaleDay] ), MONTH(Table[SaleDay]) <= MAX ( MONTH(Table[SaleDay]) ) && YEAR ( Table[SaleDay] ) = 2016 ) )
and your result would look like:
Do You have predefined values for years? If so, you can create a measure for given years current total and place them on your chart.
A measure definition could be like that:
2016 = CALCULATE ( [your measure], FILTER ( ALL ( Table[SaleDay] ), MONTH(Table[SaleDay]) <= MAX ( MONTH(Table[SaleDay]) ) && YEAR ( Table[SaleDay] ) = 2016 ) )
and your result would look like:
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 |
---|---|
114 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |