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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ivvan_smo
New Member

Comparison of two data points with different submission date

Dear all, 

I have following dataset:

TitleValueSubmission date
Test 11006/1/2024
Test 22006/1/2024
Test 33006/1/2024
Test 11006/2/2024
Test 23506/2/2024
Test 34006/2/2024
Test 42506/2/2024
Test 22006/3/2024
Test 34006/3/2024
Test 52006/3/2024

 

Ideally I would like to create a comparison in a table showing all the projects available in the data set with corresponding value at last submission date and difference vs. submission chosen in Slicer. For example, If I choose my comparison date to 6/1/2024, the outcome should look like this.

 

TitleLast submissionDiff vs last submission
Test 10-100
Test 22000
Test 3400100
Test 400
Test 5200200

 

Thanks  a lot for your help in advance. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from@ryan_mayu , please allow me to provide another insight:
Hi,@ivvan_smo 

1.First use the calculation table:

 

Table 2 = DISTINCT('Table'[Title])
Table 3 = VALUES('Table'[Submission date])

 

The column in table3 is used as a slicer to prevent the slicer from affecting the measure and calculation column.

 

2.Next create relationships between tables:

vlinyulumsft_0-1719539600665.png

3.Create calculated column references:

 

Last submission = 
VAR cc=CALCULATE(SUM('Table'[Value]),'Table'[Submission date]=MAX('Table'[Submission date]))
RETURN IF(cc=BLANK(),0,cc)
 

 

4. Below are the measure I've created for your needs:

 

Diff vs last submission = 
VAR select111=SELECTEDVALUE('Table 3'[Submission date])
VAR now11=CALCULATE(SUM('Table'[Value]),'Table'[Submission date]=select111)
RETURN MAX('Table 2'[Last submission])-now11

 

5.Here's my final result, which I hope meets your requirements.

vlinyulumsft_1-1719539658380.png

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks for the reply from@ryan_mayu , please allow me to provide another insight:
Hi,@ivvan_smo 

1.First use the calculation table:

 

Table 2 = DISTINCT('Table'[Title])
Table 3 = VALUES('Table'[Submission date])

 

The column in table3 is used as a slicer to prevent the slicer from affecting the measure and calculation column.

 

2.Next create relationships between tables:

vlinyulumsft_0-1719539600665.png

3.Create calculated column references:

 

Last submission = 
VAR cc=CALCULATE(SUM('Table'[Value]),'Table'[Submission date]=MAX('Table'[Submission date]))
RETURN IF(cc=BLANK(),0,cc)
 

 

4. Below are the measure I've created for your needs:

 

Diff vs last submission = 
VAR select111=SELECTEDVALUE('Table 3'[Submission date])
VAR now11=CALCULATE(SUM('Table'[Value]),'Table'[Submission date]=select111)
RETURN MAX('Table 2'[Last submission])-now11

 

5.Here's my final result, which I hope meets your requirements.

vlinyulumsft_1-1719539658380.png

 

 

ivvan_smo
New Member

see the screenshot of the data for better understanding of it.

ivvan_smo_0-1719325509069.png

 

@ivvan_smo 

pls see the attachment below

 

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.