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.
Dear all,
1. I want to find the current session score (or the lastest session date's score for a single person), below dax give my blank() result:
Solved! Go to Solution.
Hi @xiumi_hou ,
I created a sample that you can try and check if is what you want.
Newest score =
var max_date = CALCULATE(MAX('Table'[Session date]),ALLEXCEPT('Table','Table'[EMPLOYEE Id]))
return
CALCULATE(SUM('Table'[SCORE]),FILTER('Table','Table'[Session date] = max_date))
Increase =
var max_date = CALCULATE(MAX('Table'[Session date]),ALLEXCEPT('Table','Table'[EMPLOYEE Id]))
var last_score = CALCULATE(SUM('Table'[SCORE]),FILTER(ALLEXCEPT('Table','Table'[EMPLOYEE Id]),'Table'[Session date] = MAX('Table'[Session date]) - 1))
var percentage = DIVIDE([Newest score] - last_score,last_score)
return
IF(MAX('Table'[Session date]) = max_date,percentage,BLANK())
Note : They are both measures.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.
Hi @xiumi_hou ,
Would you be able to give us an example of your expected outcome and copy and paste the table you have in the picture? It would be good if you could copy and paste the values in the message rather than a picture, even if you have to dummy one up in Excel.
Please read this post to get your question answered more quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Thank you,
Nathaniel
Proud to be a Super User!
Thanks for answering.
I need two calculations:
1. When I filter employee 1, I want to add a new column or a measure to show the newest score. (In this table should be 8
2.I want to see whether this employee improved or not. So I will compare the most recent two dates, the percentage i am expecting is (8-4)/4*100%
Below is my data:
EMPLOYEE Id | Session date | SCORE |
1 | 4/5/2018 | 2 |
1 | 4/6/2018 | 4 |
1 | 4/7/2018 | 8 |
2 | 4/4/2018 | 2 |
2 | 4/5/2018 | 1 |
2 | 4/6/2018 | 7 |
3 | 4/7/2018 | 6 |
Hi @xiumi_hou ,
I created a sample that you can try and check if is what you want.
Newest score =
var max_date = CALCULATE(MAX('Table'[Session date]),ALLEXCEPT('Table','Table'[EMPLOYEE Id]))
return
CALCULATE(SUM('Table'[SCORE]),FILTER('Table','Table'[Session date] = max_date))
Increase =
var max_date = CALCULATE(MAX('Table'[Session date]),ALLEXCEPT('Table','Table'[EMPLOYEE Id]))
var last_score = CALCULATE(SUM('Table'[SCORE]),FILTER(ALLEXCEPT('Table','Table'[EMPLOYEE Id]),'Table'[Session date] = MAX('Table'[Session date]) - 1))
var percentage = DIVIDE([Newest score] - last_score,last_score)
return
IF(MAX('Table'[Session date]) = max_date,percentage,BLANK())
Note : They are both measures.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.
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 |
---|---|
107 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |