Forum Discussion
Filtering Consecutive Dates by a Measure
- 1 year ago
hello AMONT
Glad it is worked as intended.
if you need to limit certain id, you can add more condition inside the filter.
for example:
MAXX(
FILTER(
ALL('Table'),
'Table'[DateOnly]<_Select&&
'Table'[Well_ID]=_ID *** adding at top var _ID = SELECTEDVALUE('Table'[Well_ID])***
),
'Table'[DateOnly]
)or directly use should have same result :
MAXX(
FILTER(
ALL('Table'),
'Table'[DateOnly]<_Select&&
'Table'[Well_ID]=SELECTEDVALUE('Table'[Well_ID])
),
'Table'[DateOnly]
)This way, the measure only calculate for previous date AND for same ID.
you can add more filter condition as you need as above.
Hope this will help.
Thank you.
First off, I appreciate all the time you've put into this. I owe you big time! I know this is so close to correct, but I have no idea what I'm doing wrong.
The [Measure Total Days With 3 Exceed Ref] doesn't work in my pbix. I cannot perform the SUM measure since it's not a column in the table, just a measure based on several other measures as described above. As such, I get a weird result in all the other formulas that you provided.
I think I need a measure to mimic your measure, but in the summation of the [Total Days With 3 Exceed Ref] measure that I have. In the Card that I added, it defaults to the sum, so I guess I need that in a measure to make the same result?
One thing to make sure is clear, this is a single well (Well 100) example. I have over 100 wells. So I am assuming I need the measure to be filtered by well number.
hello AMONT
i think if [measure total days with exceed]is a measure, then you should have no issue.
The SUM in [measure total days with exceed] in my pbix is meant to make [measure total days with exceed] behaves as measure.
You can do your [measure total days with exceed] measure to continue your calculation.
If you still have wrong result perhaps you have another calculation that affect your final desired outcome.
Please share your pbix contained of a sample of your original data so we can work it out to achive your desired outcome.
Please remove any confidential information.
Thank you.
- AMONT1 year agoFrequent Visitor
Hello,
I began to pull a subset of the data with the Well 100 example, and once that data was on it's own, without any other wells, the measures and everything worked just like your screenshots!
So it will definitely work, but I think I need things filtered by the [Well_Number] field that I have, as all the wells can have the same dates. In that case, with the measures that you provided, would I just update the filters in some way to make the measures calculate not only by DateOnly, but also by Well_Number?
I can pull a data subset with 2-3 wells if that would help.
- Irwan1 year agoSuper User
hello AMONT
Glad it is worked as intended.
if you need to limit certain id, you can add more condition inside the filter.
for example:
MAXX(
FILTER(
ALL('Table'),
'Table'[DateOnly]<_Select&&
'Table'[Well_ID]=_ID *** adding at top var _ID = SELECTEDVALUE('Table'[Well_ID])***
),
'Table'[DateOnly]
)or directly use should have same result :
MAXX(
FILTER(
ALL('Table'),
'Table'[DateOnly]<_Select&&
'Table'[Well_ID]=SELECTEDVALUE('Table'[Well_ID])
),
'Table'[DateOnly]
)This way, the measure only calculate for previous date AND for same ID.
you can add more filter condition as you need as above.
Hope this will help.
Thank you.