cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wongchungjec Regular Visitor
Regular Visitor

Calculate with filter doesn't return expected value

Hi all,

 

I have a simplified example of what happen in practice.

There is a fact table in which history is kept. These can be identified with the RunID's.

 

I want to sum all the values from the lastest RunID (=2). This should be 100+200=300

 

2019-02-20_21-10-04.png

 

In order to determine the latest RunID, I've created the following measure. I've created a card to verify and it states 2, as expected.

 

2019-02-20_21-11-08.png

 

When I create my measure to sum all values from RunID 2 and reference to the previous measure, it just sums all values with a total of 330. If I 'hardcode' the lates RunID, it does return the sum of the values of only Run 2.

How come these measures don't return the same results?

 

2019-02-20_21-11-21.png2019-02-20_21-11-39.png

1 ACCEPTED SOLUTION

Accepted Solutions
ElenaN Member
Member

Re: Calculate with filter doesn't return expected value

Hello,

 

To solve your issue you can change your formula for LatestRun to:

 

LatestRun = CALCULATE(MAX(Table1[RunID]),ALL(Table1))

Regards,

ElenaN

View solution in original post

2 REPLIES 2
ElenaN Member
Member

Re: Calculate with filter doesn't return expected value

Hello,

 

To solve your issue you can change your formula for LatestRun to:

 

LatestRun = CALCULATE(MAX(Table1[RunID]),ALL(Table1))

Regards,

ElenaN

View solution in original post

wongchungjec Regular Visitor
Regular Visitor

Re: Calculate with filter doesn't return expected value

 This seems to work!

 

However, what is the reason the initial LatesRunId measure didn't return the required outcome?

 

Thank you very much!

Helpful resources

Announcements
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 196 members 2,367 guests
Please welcome our newest community members: