Forum Discussion
last 3 Days Variance per ID
I can't really fathom your logic as to how you are getting red, yellow, green, I'm not comprehending your explanation of it. But it is going to be something like:
Last 3 =
VAR __tmpTable = SUMMARIZE(FILTER(ALL('Sample'),[ID]=EARLIER([ID]) && [Date]<=EARLIER([Date]) && [Date]>=EARLIER([Date])-2),'Sample'[Bucket])
VAR __rows = COUNTROWS(__tmpTable)
RETURN
IF(__rows = 1,MAXX(__tmpTable,[Bucket]),IF("Yellow" IN __tmpTable, "Yellow", IF("Green" IN __tmpTable, "Green", "Red")))
Greg,
Can you please attach pbix file so it would be helpful.
- Greg_Deckler8 years agoCommunity Champion
Sure.
- anil_power8 years agoRegular Visitor
Thanks Greg, your reply was really helpful.
The Bucket column in data I am calculated using below formula.
Bucket = Switch ( True(),
And( [Avg Discount %]>=-10 ,[Avg Discount %] < [TMax 5% Var]) , "Green",
And( [Avg Discount %]>=[TMax 5% Var],[Avg Discount %] < [TMax 15% Var]) , "Yellow",
And( [Avg Discount %] >= [TMax 15% Var],[Avg Discount %] < 500), "Red")
and I have used the calculated column formula given by you, but I am facing dependency error while applying the formula
- v-piga-msft8 years agoResident Rockstar
Hi anil_power,
Please refer to this blog to avoid A circular Dependency was detected" error.
Best Regards,
Cherry