Forum Discussion
Datediff Probleam
- Anonymous2 years ago
Change your vLastDate to:
CALCULATE(LASTDATE(dimCalendario[Data]), ALLSELECTED(dimCalendario))The problem is that your date context in your table means "LastDate" is currently giving you the last date of that year, which will always be a datediff of 0.
- Anonymous2 years ago
Best practise is to model your data in a Star Schema. I would suggest adding to your model a "Person" table, that contains 1 row per person. Then use a unique ID to create a relationship between your person table and the data table. When building your visuals, use the Person table's fields on your report. When using the measure, this will constrain your measure to run once for each person.
To creature an average, we'll use the Average iterator function. I'll assume you have a person table for my example:
Average Example = AVERAGEX( VALUES('People'[Person Name]), [Tempo de Empresa] )
Thank you very much. I managed to solve it. Now I need just one more help, if I can. 1 - I would like to know how I can group the number of employees according to this measure I created. 2- How can I calculate the average of this measurement I created Thank you again in advance
Best practise is to model your data in a Star Schema. I would suggest adding to your model a "Person" table, that contains 1 row per person. Then use a unique ID to create a relationship between your person table and the data table. When building your visuals, use the Person table's fields on your report. When using the measure, this will constrain your measure to run once for each person.
To creature an average, we'll use the Average iterator function. I'll assume you have a person table for my example:
Average Example = AVERAGEX(
VALUES('People'[Person Name]),
[Tempo de Empresa]
)