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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MartiJoo
Helper I
Helper I

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

@MartiJoo , 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!

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

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 @MartiJoo, because you have multiple tables it would be useful if you can share *.pbix file with the created data model and some sample data.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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