DAX to get latest date of an account name entry
up vote
1
down vote
favorite
I have found similar reported questions, but none of the solutions have worked so far. If I am entering the information incorrectly, please let me know.
I have a table in Power Pivot that contains repeated names, and dates entered that go with the names. What I am trying to do is get the latest date entered for a name.
Example:
Name | Date | Latest Date
A | 6/24/2016 |
A | 6/24/2017 |
A | 6/24/2018 |
B | 7/05/2010 |
B | 7/05/2011 |
C | 6/8/2009 |
C | 6/8/2010 |
C | 6/8/2011 |
What I would like under Latest Date is to have the latest date that corresponds to the Name. It should look like the following:
Name | Date | Latest Date
A | 6/24/2016 | 6/24/2018
A | 6/24/2017 | 6/24/2018
A | 6/24/2018 | 6/24/2018
B | 7/05/2010 | 7/5/2011
B | 7/05/2011 | 7/5/2011
C | 6/8/2009 | 6/8/2011
C | 6/8/2010 | 6/8/2011
C | 6/8/2011 | 6/8/2011
I've tried to use the following function, but all I keep getting are #Errors (of course changing the table reference based on the data in the file)
= CALCULATE(
MAX(Table1[Date]);
FILTER(Table1;
Table1[ID] = EARLIER(Table1[ID])
)
)
If the above function is correct, I wonder what I am doing wrong. Which one of the values in the () are column references and which ones are cell references? Perhaps that's where I am going wrong.
Any assistance is very appreciative. I tried to enter the information as nicely as possible so it can be assisted.
dax powerpivot
add a comment |
up vote
1
down vote
favorite
I have found similar reported questions, but none of the solutions have worked so far. If I am entering the information incorrectly, please let me know.
I have a table in Power Pivot that contains repeated names, and dates entered that go with the names. What I am trying to do is get the latest date entered for a name.
Example:
Name | Date | Latest Date
A | 6/24/2016 |
A | 6/24/2017 |
A | 6/24/2018 |
B | 7/05/2010 |
B | 7/05/2011 |
C | 6/8/2009 |
C | 6/8/2010 |
C | 6/8/2011 |
What I would like under Latest Date is to have the latest date that corresponds to the Name. It should look like the following:
Name | Date | Latest Date
A | 6/24/2016 | 6/24/2018
A | 6/24/2017 | 6/24/2018
A | 6/24/2018 | 6/24/2018
B | 7/05/2010 | 7/5/2011
B | 7/05/2011 | 7/5/2011
C | 6/8/2009 | 6/8/2011
C | 6/8/2010 | 6/8/2011
C | 6/8/2011 | 6/8/2011
I've tried to use the following function, but all I keep getting are #Errors (of course changing the table reference based on the data in the file)
= CALCULATE(
MAX(Table1[Date]);
FILTER(Table1;
Table1[ID] = EARLIER(Table1[ID])
)
)
If the above function is correct, I wonder what I am doing wrong. Which one of the values in the () are column references and which ones are cell references? Perhaps that's where I am going wrong.
Any assistance is very appreciative. I tried to enter the information as nicely as possible so it can be assisted.
dax powerpivot
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have found similar reported questions, but none of the solutions have worked so far. If I am entering the information incorrectly, please let me know.
I have a table in Power Pivot that contains repeated names, and dates entered that go with the names. What I am trying to do is get the latest date entered for a name.
Example:
Name | Date | Latest Date
A | 6/24/2016 |
A | 6/24/2017 |
A | 6/24/2018 |
B | 7/05/2010 |
B | 7/05/2011 |
C | 6/8/2009 |
C | 6/8/2010 |
C | 6/8/2011 |
What I would like under Latest Date is to have the latest date that corresponds to the Name. It should look like the following:
Name | Date | Latest Date
A | 6/24/2016 | 6/24/2018
A | 6/24/2017 | 6/24/2018
A | 6/24/2018 | 6/24/2018
B | 7/05/2010 | 7/5/2011
B | 7/05/2011 | 7/5/2011
C | 6/8/2009 | 6/8/2011
C | 6/8/2010 | 6/8/2011
C | 6/8/2011 | 6/8/2011
I've tried to use the following function, but all I keep getting are #Errors (of course changing the table reference based on the data in the file)
= CALCULATE(
MAX(Table1[Date]);
FILTER(Table1;
Table1[ID] = EARLIER(Table1[ID])
)
)
If the above function is correct, I wonder what I am doing wrong. Which one of the values in the () are column references and which ones are cell references? Perhaps that's where I am going wrong.
Any assistance is very appreciative. I tried to enter the information as nicely as possible so it can be assisted.
dax powerpivot
I have found similar reported questions, but none of the solutions have worked so far. If I am entering the information incorrectly, please let me know.
I have a table in Power Pivot that contains repeated names, and dates entered that go with the names. What I am trying to do is get the latest date entered for a name.
Example:
Name | Date | Latest Date
A | 6/24/2016 |
A | 6/24/2017 |
A | 6/24/2018 |
B | 7/05/2010 |
B | 7/05/2011 |
C | 6/8/2009 |
C | 6/8/2010 |
C | 6/8/2011 |
What I would like under Latest Date is to have the latest date that corresponds to the Name. It should look like the following:
Name | Date | Latest Date
A | 6/24/2016 | 6/24/2018
A | 6/24/2017 | 6/24/2018
A | 6/24/2018 | 6/24/2018
B | 7/05/2010 | 7/5/2011
B | 7/05/2011 | 7/5/2011
C | 6/8/2009 | 6/8/2011
C | 6/8/2010 | 6/8/2011
C | 6/8/2011 | 6/8/2011
I've tried to use the following function, but all I keep getting are #Errors (of course changing the table reference based on the data in the file)
= CALCULATE(
MAX(Table1[Date]);
FILTER(Table1;
Table1[ID] = EARLIER(Table1[ID])
)
)
If the above function is correct, I wonder what I am doing wrong. Which one of the values in the () are column references and which ones are cell references? Perhaps that's where I am going wrong.
Any assistance is very appreciative. I tried to enter the information as nicely as possible so it can be assisted.
dax powerpivot
dax powerpivot
edited Nov 13 at 17:39
Alexis Olson
11.6k21633
11.6k21633
asked Nov 13 at 16:51
KLomb
112
112
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
There are no cell or row references in DAX. Everything is done with filters.
Try this for Latest Date.
= CALCULATE(
MAX(Table1[Date]);
FILTER(ALL(Table1);
Table1[Name] = EARLIER(Table1[Name])
)
)
Give this a shot as well if that doesn't do the trick:
= CALCULATE(
MAX(Table1[Date]);
ALLEXCEPT(Table1; Table1[Name])
)
Thank you very much. That worked.
– KLomb
Nov 13 at 20:43
Please mark an answer as accepted if it solved your problem. stackoverflow.com/help/someone-answers
– Alexis Olson
Nov 13 at 21:04
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
There are no cell or row references in DAX. Everything is done with filters.
Try this for Latest Date.
= CALCULATE(
MAX(Table1[Date]);
FILTER(ALL(Table1);
Table1[Name] = EARLIER(Table1[Name])
)
)
Give this a shot as well if that doesn't do the trick:
= CALCULATE(
MAX(Table1[Date]);
ALLEXCEPT(Table1; Table1[Name])
)
Thank you very much. That worked.
– KLomb
Nov 13 at 20:43
Please mark an answer as accepted if it solved your problem. stackoverflow.com/help/someone-answers
– Alexis Olson
Nov 13 at 21:04
add a comment |
up vote
0
down vote
There are no cell or row references in DAX. Everything is done with filters.
Try this for Latest Date.
= CALCULATE(
MAX(Table1[Date]);
FILTER(ALL(Table1);
Table1[Name] = EARLIER(Table1[Name])
)
)
Give this a shot as well if that doesn't do the trick:
= CALCULATE(
MAX(Table1[Date]);
ALLEXCEPT(Table1; Table1[Name])
)
Thank you very much. That worked.
– KLomb
Nov 13 at 20:43
Please mark an answer as accepted if it solved your problem. stackoverflow.com/help/someone-answers
– Alexis Olson
Nov 13 at 21:04
add a comment |
up vote
0
down vote
up vote
0
down vote
There are no cell or row references in DAX. Everything is done with filters.
Try this for Latest Date.
= CALCULATE(
MAX(Table1[Date]);
FILTER(ALL(Table1);
Table1[Name] = EARLIER(Table1[Name])
)
)
Give this a shot as well if that doesn't do the trick:
= CALCULATE(
MAX(Table1[Date]);
ALLEXCEPT(Table1; Table1[Name])
)
There are no cell or row references in DAX. Everything is done with filters.
Try this for Latest Date.
= CALCULATE(
MAX(Table1[Date]);
FILTER(ALL(Table1);
Table1[Name] = EARLIER(Table1[Name])
)
)
Give this a shot as well if that doesn't do the trick:
= CALCULATE(
MAX(Table1[Date]);
ALLEXCEPT(Table1; Table1[Name])
)
answered Nov 13 at 17:44
Alexis Olson
11.6k21633
11.6k21633
Thank you very much. That worked.
– KLomb
Nov 13 at 20:43
Please mark an answer as accepted if it solved your problem. stackoverflow.com/help/someone-answers
– Alexis Olson
Nov 13 at 21:04
add a comment |
Thank you very much. That worked.
– KLomb
Nov 13 at 20:43
Please mark an answer as accepted if it solved your problem. stackoverflow.com/help/someone-answers
– Alexis Olson
Nov 13 at 21:04
Thank you very much. That worked.
– KLomb
Nov 13 at 20:43
Thank you very much. That worked.
– KLomb
Nov 13 at 20:43
Please mark an answer as accepted if it solved your problem. stackoverflow.com/help/someone-answers
– Alexis Olson
Nov 13 at 21:04
Please mark an answer as accepted if it solved your problem. stackoverflow.com/help/someone-answers
– Alexis Olson
Nov 13 at 21:04
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53285889%2fdax-to-get-latest-date-of-an-account-name-entry%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown