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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculate the difference between two closest date, and significance difference

I would like to calculate the score difference between the lastest score and its closest past score of the same Name, and then show the difference by show the green up, red down and no change symbol. Also, I would like to test whether the change has a significant change in the difference when comparing it, and show it as a filled circle and non-filled circle. Below is the small sample data.

 

 

IDName ScoreDate
1A71/9/2022
2B83/9/2022
3C95/9/2022
4A611/9/2022
5B818/9/2022
6C419/9/2022
7A920/9/2022
8A1021/9/2022
9B622/9/2022
10C1024/9/2022

 

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

I tried to create something like below.

When searching for UNICHAR symbols, I could not find what you want, but I hope you can find ones.

Please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to create a solution for your actual data model.

All measures are in the attached pbix file.

 

Jihwan_Kim_1-1663731427706.png

 

Jihwan_Kim_0-1663731415410.png

 


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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

What I mean significance here is testing the statistically significance difference, which mean i have to use the one-tailed t-test

amitchandak
Super User
Super User

@Anonymous , A new column

 

var _date= maxx(filter(Table, [Name] = earlier([Name]) && [Date] < earlier([Date]) ), [Date])

return

[score]- maxx(filter(Table, [Name] = earlier([Name]) && [Date] =_date ), [score]) 

 

or a measure

 

anew meausre =

 

var _date= maxx(filter(allselected(Table) , [Name] = max([Name]) && [Date] < max([Date]) ), [Date])

return

max([score]) - maxx(filter(Table, [Name] = max([Name]) && [Date] =_date ), [score]) 

 

or

 

sum measure

 

var _date= maxx(filter(allselected(Table) , [Name] = max([Name]) && [Date] < max([Date]) ), [Date])

return

sum([score]) - sumxx(filter(Table, [Name] = max([Name]) && [Date] =_date ), [score]) 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks for you reply. Do you also know how to solve the same problem but changed to the below tables? Many thanks.

 

IndexName IDQuestionDate
1A1Q1_A11/9/2022
2A2Q1_A23/9/2022
3C1Q1_A55/9/2022
4A3Q1_A411/9/2022
5B1Q1_A218/9/2022
6C2Q1_A319/9/2022
7A4Q1_A320/9/2022
8A5Q1_A221/9/2022
9B2Q1_Q122/9/2022
10C3Q1_A124/9/2022
Q & Ans no.Score
Q1_A110
Q1_A28
Q1_A35
Q1_A42
Q1_A50

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.