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 need help on dax How to calculate sales from specify year as I have multiple year. I want to calculate sales from 2021 1st Jan till 2025 or so on
Solved! Go to Solution.
Hi @mdaamirkhan
Your question isn't very clear and you have only provided a column of dates, no other data.
Are you trying to calculate sales for a selected year e.g. Sales for 2019, Sales for 2020 etc?
If so, and if you have data like this,
then you just need a slicer showing the years in your dates and this measure
Sales for Year = IF(ISFILTERED('Table'[Date].[Year]),CALCULATE(SUM('Table'[Sales]), FILTER(ALL('Table'), YEAR('Table'[Date]) = YEAR(MAX('Table'[Date])))),"")
This isn't using a DateTable. If you have a dateTable the measure will be different. Please provide more information and an exampleof your desired result.
regards
Phil
Proud to be a Super User!
Hi,
I am not sure if you need to figure it out like below, but please correct me if I were wrong.
Please check the below DAX measure, picture, and link.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
I appiled your dax but it shwoing same value duplicate
Hi @mdaamirkhan
I don't see anywhere that you have provided sample data in an Excel or PBIX file. Please re-post the link.
What you want still remains a little unclear.
Do you want (for example) cards that show the sales for each year? The meaning of the red lines in your images isn't clear. I don't know what they are meant to indicate.
regards
Phil
Proud to be a Super User!
Hi @mdaamirkhan
I don't see anywhere that you have provided sample data in an Excel or PBIX file. Please re-post the link.
What you want still remains a little unclear.
Do you want (for example) cards that show the sales for each year? The meaning of the red lines in your images isn't clear. I don't know what they are meant to indicate.
regards
Phil
Proud to be a Super User!
Hi,
I am not sure if you need to figure it out like below, but please correct me if I were wrong.
Please check the below DAX measure, picture, and link.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
I appiled your dax but it shwoing same value duplicate
Hi, @mdaamirkhan
Thank you for your feedback.
I think, if the model is different, sometimes it creates an unexpected result.
Did you see my sample PBIX file?
I think, at least it works in my sample PBIX file.
If you can share your sample pbix file, please share it.
If it is possible, I can try to create another measure based on your model.
Thank you very much.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi @mdaamirkhan
Your question isn't very clear and you have only provided a column of dates, no other data.
Are you trying to calculate sales for a selected year e.g. Sales for 2019, Sales for 2020 etc?
If so, and if you have data like this,
then you just need a slicer showing the years in your dates and this measure
Sales for Year = IF(ISFILTERED('Table'[Date].[Year]),CALCULATE(SUM('Table'[Sales]), FILTER(ALL('Table'), YEAR('Table'[Date]) = YEAR(MAX('Table'[Date])))),"")
This isn't using a DateTable. If you have a dateTable the measure will be different. Please provide more information and an exampleof your desired result.
regards
Phil
Proud to be a Super User!
without any yrar slicer I want to calculate sales amount starting from 2021 til so on.
As I have few years like 2019 , 2020 , 2021 , 2022 , 2023, 204
Hi,
I was reading your question, but sorry to say that your attached picture made me a little bit confused.
May I ask what is the meaning of the red-color marks?
If it is OK with you, please share the sample data, then I can try to create a DAX, if possible.
Thank you very much.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
I already share the data in the excel file also share the link to download. red color line mean I am referring that date is like that.
still I didn't get any update
Will I get any solution from the group
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 |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |