Forum Discussion
Calculation shows filtered lines
Hi,
I have some different data which I all connected to each other with relationships. I want to show data of only the last 3 days on my dashboard.
Data1:
Date
Date |
| 01/01/2008 |
| 02/01/2008 |
Data2:
Quality
| Quality | Date | Time |
| Xt2 | 19 august 2023 | 23:59:53 |
| Xt2 | 19 august 2023 | 23:59:33 |
| Xt2 | 19 august 2023 | 23:59:13 |
Data3:
Performance
| Performance | Date | Time |
| 1223 | 19 august 2023 | 04:00:00 |
| 1211 | 19 august 2023 | 12:00:00 |
| 1111 | 19 august 2023 | 20:00:00 |
Data4:
Guidelines
| Product | Needed performance each day |
| Xt2 | 4.2 |
| Xt3 | 3.3 |
| Xt4 | 5.0 |
I made calculation:
| Date | Time | Quality | Performance | Guide Performance |
| 19/08/2023 | 04:00:00 | Xt2 | 1223 | 1400 |
| 19/08/2023 | 12:00:00 | Xt2 | 1211 | 1400 |
When I add the 'Guide Performance' field it seems it shows all the lines in 'Performance' from history till now instead of only the last 3 days. If I remove 'Guide Performance' it shows only the last 3 days. What am I doing wrong?
Martijn
5 Replies
- Sergii24Super User
Hello Anonymous, because you have multiple tables it would be useful if you can share *.pbix file with the created data model and some sample data.
- AnonymousNot applicable
Hi Sergii24, unfortunately that won't be possible as it's both company data and also live data received by an API from a procescontrol-system. I wouldn't be able to add that data even if I wanted too
- ERDCommunity Champion
Anonymous , you either need to filter dates on your visual, or include this filtering in your formulas.
- AnonymousNot applicable
Thanks for your reply, what is the best way to include this filter in my formula?
- ERDCommunity Champion
Something like this:
measure = CALCULATE( your_calculation, Date[Date] <= TODAY () && Date[Date] > TODAY () - 3)You can also try this: https://dax.guide/datesbetween/ .
Today: https://dax.guide/today/.