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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
sivasrao
Helper III
Helper III

Last Data Value and Count

Event ActivityEvent TimeTarget 1Target 2
1C100010000
1C100110010
1C100210023
1R100310020
1R100410020
1R100510020
1C100610060
1C100710072
1R100810070
1R100910070

 

Target 1: Whenever R comes, the value of the Time column is the previous value of C (like 1002)

Target 2: Count of R's value saved as the value of the previous C column.

 

Please help with this.

7 REPLIES 7
shrabedi
Frequent Visitor

For Target 1

Target 1 = 
IF('Table'[Event] = "R",
   CALCULATE(
       MAX('Table'[Time]),
       FILTER('Table', 'Table'[Event] = "C" && 'Table'[Time] < EARLIER('Table'[Time]))
   ),
   'Table'[Time]
)

Regards
Accept as a solution if it works.

Thank you for your quick reply.

 Target 2 is the more preferable requirement.

Pls try on this too.

Please elaborate on Target 2.

The count of R values will be assigned to the previous column of the first R.

 

In this example, R will start from the 4th column up to the 6th column. The total Count is 3.

The value 3 will assign to the 3rd column.

 

Same as the 9th and 10th having R, the count is 2. That has been assigned to the 8th column.

 

I hope you understand the requirement.

Anonymous
Not applicable

.

 

Please give proper logic.

Anonymous
Not applicable

Sorry @sivasrao , I wanted the notifications on this thread. Wanted to learn how to solve the same question.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors