Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all, I have some difficulties and i need some help.
My task is to get the latest application date and also the latest status from that application date without using the power query, only the dax function(measure or column)
I have two tables which is
Status
Student
Data Model
Current Result (not correct)
Expected Result
The issue is, for each student, i need to get the latest application date that he done, and after getting that, i need to filter it by latest status by that date. Two different filtering and i don't know to do it. Hoping that someone could help me, Thanks!
@v-cazheng-msft @tamerj1 @amitchandak @SpartaBI @lbendlin @tamerj1
Solved! Go to Solution.
Hi,
Thank you for your message.
I created a measure for application date as well.
Please check the attached file, and please check if it suits your requirement.
Thank you.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
Please check the below picture and the attached pbix file.
Status expected measure: =
VAR _latestdate =
MAX ( Student[Application Date] )
VAR _maxstatuskey =
MAXX (
FILTER ( Student, Student[Application Date] = _latestdate ),
Student[Application Status Key]
)
RETURN
IF (
HASONEVALUE ( Student[Student ID] ),
CALCULATETABLE (
VALUES ( 'Status'[Status] ),
'Status'[Application Status Key] = _maxstatuskey
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi Jihwan, the measure works fine as expected, thanks!
but in my actual file, it was having major performance issues (loading data). i believe this is due to the long dax queries in the measure. And i'm kinda lost on how to simplify it. Appreciate your insights on this again, thank you so much.
Hi Jihwan_Kim, thank you for the prompt reply,
i have another question which is why when i include the application date into the chart it become like this and not showing the latest date it should be? I'm sorry for not telling the requirement earlier but the application date and status code should be shown also.
output from your edited pbi (thank you again)
expected output
and i need to use the status code to do the filtering and not by application status key. Hoping you have a nice day and can guide me further on this, thank you !
Hi,
Thank you for your explanation.
I fixed the measure.
By the way, if you want to slice by Status, I think creating a new table is also the way.
I am not sure how your expected outcome looks like when slicing by STATUS, but please check the attached file.
I also create a new table.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi Jihwan, thank you again for your prompt reply, i really do appreciate your concern on this issue.
But apparently i'm still having the same result which is this,
expected result(without selecting anything from the slicer), as you can see, it's showing the latest date and the latest status which is for example for student A2, there same status in the different latest date(rejected). the result that it should be is only on the latest one which is on 2 January.
Hoping that you can provide your insights more on this, thank you!
Hi,
Thank you for your message.
I created a measure for application date as well.
Please check the attached file, and please check if it suits your requirement.
Thank you.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Works like wonders, Thank you for the helps!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
42 | |
33 | |
30 | |
18 | |
18 |