Forum Discussion
Excluding data query help
- 4 years ago
Hi gunther15 ,
To include the current month please try the following measure.
Note that the Calendar table must have the full date of the current month.
Measure = CALCULATE ( COUNTROWS ( 'Table' ), DATESINPERIOD ( 'Calendar'[Date], EOMONTH ( TODAY (), 0 ), -4, MONTH ), FILTER ( 'Table', 'Table'[State] = "pending" && 'Table'[Quotes] >= 25000 ) )If there are duplicate data on the same day, as "7/1/2022" shown in the figure, and you need to compare the summarized data (i.e. 310000), then please try the following measure.
Measure2 = CALCULATE ( COUNTROWS ( 'Table' ), DATESINPERIOD ( 'Calendar'[Date], EOMONTH ( TODAY (), 0 ), -4, MONTH ), FILTER ( SUMMARIZE ( FILTER ( 'Table', 'Table'[State] = "pending" ), 'Calendar'[Date], "_Quotes", CALCULATE ( SUM ( 'Table'[Quotes] ) ) ), [_Quotes] >= 25000 ) )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
I actually got the measurement query now to work. I was wondering though how do you get it to include the current month as well. It is only filtering out the 4 months prior to the current month and I was wondering how do you get the measurement to include July for example. So I would want the data to be filtered out would be July, June, May and April.
Hi gunther15 ,
To include the current month please try the following measure.
Note that the Calendar table must have the full date of the current month.
Measure =
CALCULATE (
COUNTROWS ( 'Table' ),
DATESINPERIOD ( 'Calendar'[Date], EOMONTH ( TODAY (), 0 ), -4, MONTH ),
FILTER ( 'Table', 'Table'[State] = "pending" && 'Table'[Quotes] >= 25000 )
)
If there are duplicate data on the same day, as "7/1/2022" shown in the figure, and you need to compare the summarized data (i.e. 310000), then please try the following measure.
Measure2 =
CALCULATE (
COUNTROWS ( 'Table' ),
DATESINPERIOD ( 'Calendar'[Date], EOMONTH ( TODAY (), 0 ), -4, MONTH ),
FILTER (
SUMMARIZE (
FILTER ( 'Table', 'Table'[State] = "pending" ),
'Calendar'[Date],
"_Quotes", CALCULATE ( SUM ( 'Table'[Quotes] ) )
),
[_Quotes] >= 25000
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.