Forum Discussion
Identifying resamples
- 6 years ago
HI,
Can you try below formula 🙂
Resampled =
IF (
CALCULATE (
COUNTA ( check[Sampling Point] ),
ALLEXCEPT ( check, check[Sampled Date], check[Sampling Point ] )
) > 1,
TRUE (),
FALSE ()
)Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂Regards,
N V Durga Prasad
jnw022 -
Resampled Column =
VAR __Date = [Sampled Date]
VAR __Count = COUNTROWS(FILTER(ALL('Table'),[Sampled Date]=__Date))
RETURN
IF(__Count = 1,FALSE(),TRUE())
Resampled Measure =
VAR __Date = MAX([Sampled Date])
VAR __Count = COUNTROWS(FILTER(ALL('Table'),[Sampled Date]=__Date))
RETURN
IF(__Count = 1,FALSE(),TRUE())
Also, since I see you are a New Member.
Please check out this article: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Greg_Deckler , thank you for your prompt response.
However, from what I can tell, your solution will tell me whether more than one sample at all was taken on the same day. What I am interested in is whether more than one sample from the same sample point was taken on the same day. That is, the [Resampled] column should only evaluate to true if >1 samples from A (or B, C, D) were taken on the same day. There will certainly be multiple samples from many different places every day, but I'm only trying to flag when we catch the same one multiple times.
If the background helps, I'm an industrial chemist who is tracking sample burden for a plant. Ideally there would be only one sample for each required location per day, but sometimes the results are suspect and we need to catch more of them. There is value in being able to distinguish when a sample was caught for that reason, rather than as part of the regular schedule.
- Greg_Deckler6 years agoCommunity Champion
jnw022 - Oh yeah, forgot to include Sampling Point:
Resampled Column = VAR __Date = [Sampled Date] VAR __Point = [Sampling Point] VAR __Count = COUNTROWS(FILTER(ALL('Table'),[Sampled Date]=__Date) && [Sampling Point] = __Point) RETURN IF(__Count = 1,FALSE(),TRUE()) Resampled Measure = VAR __Date = MAX([Sampled Date]) VAR __Point = MAX([Sampling Point]) VAR __Count = COUNTROWS(FILTER(ALL('Table'),[Sampled Date]=__Date) && [Sampling Point] = __Point) RETURN IF(__Count = 1,FALSE(),TRUE())