Forum Discussion
MTD Not Working Properly
- 3 years ago
Hi, Nigel99
You can try the following methods.
New table:Date = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))Measure = Var _table=CALCULATETABLE(VALUES('Table'[Item]),FILTER('Table',[Item]<>BLANK())) Return CALCULATE(COUNT('Table'[Item]),FILTER(ALL('Table'),[Date]<=MAX('Date'[Date])&&[Item] in _table))Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Nigel99 Try:
Measure =
VAR __Today = TODAY()
VAR __StartOfMonth = DATE( YEAR( __Today ), MONTH( __Today ), 1 )
VAR __Table = FILTER( 'Table', [Date] >= __StartOfMonth && [Date] <= __Today )
VAR __Return = COUNTROWS( __Table )
RETURN
__Return
You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008
Also:
- Nigel993 years agoFrequent Visitor
Greg_Deckler Thanks for prompt reply. I afraid that this did not work out. The DAX is dependent on date selection from date slicer instead of today date.
- Nigel993 years agoFrequent Visitor
Greg_Deckler Able to advise further? Thank you in advance
- Greg_Deckler3 years agoCommunity Champion
Nigel99 Just replace TODAY with MAX('Table'[Date]).