Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

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

QualityDateTime
Xt219 august 202323:59:53
Xt219 august 202323:59:33
Xt219 august 202323:59:13

 

Data3:

Performance

PerformanceDateTime
122319 august 202304:00:00
121119 august 202312:00:00
111119 august 202320:00:00

 

Data4:

Guidelines

ProductNeeded performance each day
Xt24.2
Xt33.3
Xt45.0

 

I made calculation: 

Guide performance = SUM('Guidelines'[Needed performance each day])/3*1000 to see it in KG's instead of tonnes
 
I made a table in PowerBi:
DateTimeQualityPerformanceGuide Performance
19/08/202304:00:00Xt212231400
19/08/202312:00:00Xt212111400

 

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 5
ERD
Community Champion
Community Champion

@Anonymous , you either need to filter dates on your visual, or include this filtering in your formulas.

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Anonymous
Not applicable

Thanks for your reply, what is the best way to include this filter in my formula?

ERD
Community Champion
Community 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/

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Sergii24
Super User
Super 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.

Anonymous
Not 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

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.