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,
I consider myself an intermediate dax user, but cannot sometimes figure out things that seem simple. here is my latest quandry. I have a table (sales table) that has the transaction date, the part number, the location, and the quantity. I created a simple clustered column chart that shows the quantity sold. the x axis of this chart is the date field (month and year). I want to add a line to this chart that shows the annual average of quantity sold as a straight horizontal line across the graph. the problem I am having is that the average quantity sold value keeps getting filtered by both month and year (and not just year), I have tried to create a measure with the following code:
Solved! Go to Solution.
@CL7777 the problem with your meaure was to use year from Calendar table instead of data table, once it was change, everything worked as expected.
Would appreciate Kudos 🙂 if my solution helped.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@CL7777 are you looking for something like this, shows average line per year
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
yes, that is what I am looking for, but the line itself (the red one in your plot) does not show the average of the data below it. Its too hight. I want the line to be the average of the column heights (the average quantity over the year)
@CL7777 I think you mean this.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
no, the red line would be the average value of the quantity over the year. So, the line would have the same amount of data (blue column data) above it as below it. The average value of the blue columns over each year is the line I want. The new line you put in looks like it is getting the max value
@CL7777 your request is not clear, it it avg, just becuase my dataset is like this, it seems that it max.
do you want avg line for each year that is what it is doing, as you can see, when year changes, the avg line changes
or do you want avg line for all the year, just one straight line. please let me know what you want, you know your data and your problem better than I do, better you explain, better solution you will get.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
something like this...
@CL7777 it is what exactly what my output is, my dataset has very similar number and thats' why average looks different, solution is attached.
Look at page 2 and related tables, there is other stuff in the file, just ignore that.
Would appreciate Kudos 🙂 if my solution helped.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks so much for working on this, however it is still not working for me. I have implemented your suggestion and I still do not get a straight line (because I have other filters). I am trying to attach my pbix file. Can you look at it and let me know why your solution doesnt work in my data? thanks so much..
https://www.dropbox.com/s/jmwftk9zqa3lbjw/Part%20History.pbix?dl=0
@CL7777 the problem with your meaure was to use year from Calendar table instead of data table, once it was change, everything worked as expected.
Would appreciate Kudos 🙂 if my solution helped.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
I want the average line for each year, so the line would be constant for 12 months and then change.
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 | |
78 | |
65 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |