Forum Discussion
Update table and last record by category
- 3 years ago
Hi Mi_80
Firstly, make sure you have the relationship correctly linked between your Date table and fact table which should be Date[Date] and Table[Created On]. From here, you can try something like the following measure:
Users (Approved) = VAR _category = "approved" Var _1 = CALCULATE ( DISTINCTCOUNT ( Table[User name] ) , FILTER ( ALL ( 'Table' ), Table[Category 1] = _category && Table[Created on] <= MAX ( 'Date'[Date] ) ) ) RETURN _1Make sure to update your Table and Column names. Also, if you want to change the category, just create a new measure and update the _category from "approved" to whatever the other category is you're wanting.
Hope this helps mate.
Theo
Hi Mi_80
Firstly, make sure you have the relationship correctly linked between your Date table and fact table which should be Date[Date] and Table[Created On]. From here, you can try something like the following measure:
Users (Approved) =
VAR _category = "approved"
Var _1 =
CALCULATE (
DISTINCTCOUNT ( Table[User name] ) ,
FILTER ( ALL ( 'Table' ),
Table[Category 1] = _category && Table[Created on] <= MAX ( 'Date'[Date] ) )
)
RETURN
_1
Make sure to update your Table and Column names. Also, if you want to change the category, just create a new measure and update the _category from "approved" to whatever the other category is you're wanting.
Hope this helps mate.
Theo
You're a star. That works fab thank you🤗
- TheoC3 years ago
Community Champion
Mi_80 I am glad it worked!
If you could accept my code as the solution, that would be awesome! Once accepted, it allows other Community users to search the forum for the solution if they experience the same issue / challenge.
Have a wonderful day and thanks again!
Theo 🙂