Forum Discussion
Create flag column for when category has new date
- 8 months ago
Assuming your table is called FactSpend with columns: Date, Audience, Advertisement, Spend
If the category is Audience: Try
FirstSpendDate_Audience =
CALCULATE (
MIN ( FactSpend[Date] ),
FILTER (
ALL ( FactSpend ),
FactSpend[Audience] = EARLIER ( FactSpend[Audience] )
&& FactSpend[Spend] > 0
)
)Flag if first spend is within last 7 days
NewAudienceFlag_Last7Days =
VAR FirstDate =
[FirstSpendDate_Audience]
VAR TodayDate =
TODAY ()
RETURN
IF (
NOT ISBLANK ( FirstDate )
&& FirstDate >= TodayDate - 7
&& FirstDate <= TodayDate,
1,
0
)
Assuming your table is called FactSpend with columns: Date, Audience, Advertisement, Spend
If the category is Audience: Try
FirstSpendDate_Audience =
CALCULATE (
MIN ( FactSpend[Date] ),
FILTER (
ALL ( FactSpend ),
FactSpend[Audience] = EARLIER ( FactSpend[Audience] )
&& FactSpend[Spend] > 0
)
)
Flag if first spend is within last 7 days
NewAudienceFlag_Last7Days =
VAR FirstDate =
[FirstSpendDate_Audience]
VAR TodayDate =
TODAY ()
RETURN
IF (
NOT ISBLANK ( FirstDate )
&& FirstDate >= TodayDate - 7
&& FirstDate <= TodayDate,
1,
0
)
- capricornucopia8 months agoFrequent Visitor
Thank you so much, that looks to have worked!