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 linechart and I have uused date slicers to select a period. My dataset consists of the following information: Storenumber, Date, Actual Sales, Model Type(Short and Long), prediciton. The short model shows a different prediction then the long prediction. So see the table below:
Store Number | Date | Actual Sales | Model Type | Prediction |
1 | 2-3-2020 | 2000 | Short | 2100 |
1 | 2-3-2020 | 2000 | Long | 2200 |
2 | 2-3-2020 | 2100 | Short | 2500 |
2 | 2-3-2020 | 2100 | Long | 2600 |
Now what I want is if the period selected is longer then 7 days I want the line chart to show only the Long model data. If the period selected is shorter then 7 days I want it to show short model data.
I hope someone can help using DAX
Solved! Go to Solution.
Hi @Anonymous ,
You could refer to my sample for details(use below measure).
Measure = IF("A" IN VALUES(T5[A or B]), CALCULATE(SUM(T5[Sales]), FILTER(T5,T5[A or B]="A")), SUM(T5[Sales]))
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I am not clear about your requirement, if possible, could you please inform me more detailed information? such as "period selected", did you mean that you want to date range slicer? And you said that " line chart to show only the Long model data", what is "long model data"? Please show me your expected output, then I will help you more correctly.
Please do mask sensitive data before uploading.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi thank you for your reply, sorry I still haven't figured it out yet. But lets forget about short or long, I will try to create a simpler sketch. Lets call it A and B. This is the data.
Date | Number | A or B | Sales |
1-1-2001 | 1 | A | 1000 |
1-1-2001 | 1 | B | 1200 |
1-2-2001 | 1 | A | 1000 |
1-2-2001 | 1 | B | 1200 |
1-3-2001 | 1 | B | 1500 |
1-4-2001 | 1 | B | 1600 |
1-5-2001 | 1 | B | 1700 |
This is the output. You can select a period using the date slicer. The black line is in this case the A Value and the green line is the B value in the plot.
In some cases A has no value, therefore it is not shown in the plot. However, once the A has a value I only want the plot to show the A value in the line chart and NOT the B value line as shown in the plot above.
Hi @Anonymous ,
You could refer to my sample for details(use below measure).
Measure = IF("A" IN VALUES(T5[A or B]), CALCULATE(SUM(T5[Sales]), FILTER(T5,T5[A or B]="A")), SUM(T5[Sales]))
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I think it can done using bookmark
https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive
Also check if this can help
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 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |