Forum Discussion
Creating a flag
- 6 years ago
Hi, Anonymous
You may create a calculated table and a measure as below.
Calculated table:
Calendar = CALENDARAUTO()Measure:
Result = Var _month = SELECTEDVALUE('Calendar'[Date].[MonthNo]) Var _year = SELECTEDVALUE('Calendar'[Date].[Ano]) Return IF( COUNTROWS( FILTER( ALL('relatorio_cartoes (74) - Copia'), YEAR('relatorio_cartoes (74) - Copia'[Order])=_year&& MONTH('relatorio_cartoes (74) - Copia'[Order])=_month&& 'relatorio_cartoes (74) - Copia'[User]=SELECTEDVALUE('relatorio_cartoes (74) - Copia'[User]) ) )>0, "Y","N" )Then you may use the 'Date' column from 'Calendar' to filter the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_DecklerThanks for the reply, well i just put the Credit column as a help to see if the measure was right. I need to do this column/measure.
Edit: sorry i understand that i left the collumn, the "credit collumn" is just if the costumer did or didnt a order on the selected month of slicer, if yes i should change all the rows of that client(it doesnt care the month,all the historic) to yes, and no if no
Thanks
Anonymous - Right, that was the intention of the calculation. It is intended as a column. Basically what it says is, get the current customer in this row and save it in the variable __Email. Now, filter the entire table and return only the rows where the customer matches __Email AND where the credit column equals "Yes". If this table (__Table) has no rows, then return 0, otherwise, return 1.