Forum Discussion
DAX Measure Showing All Records
- Anonymous3 years ago
Hi SBIM ,
Because the date fields that you add to the table visual is consecutive,.
For more details, you can read related document: TOTALMTD function (DAX) - DAX | Microsoft Learn , Total Month to Date(TOTALMTD) DAX function in Power Bi (powerbidocs.com), TOTALMTD – DAX Guide
If you only want to show current month, please try below steps:
1. below is my test table
Table:
Date Table:
create with dax formula:
Date Table = CALENDAR(FIRSTDATE('Table'[Date]),LASTDATE('Table'[Date]))2. create measure with below dax formula
Total MTD = TOTALMTD(SUM('Table'[Sale]),'Date Table'[Date])Filter Month = VAR cur_month = MONTH ( TODAY () ) VAR _m = MONTH ( SELECTEDVALUE ( 'Date Table'[Date] ) ) RETURN IF ( cur_month = _m, 1 )3. add a table visual with fields and measure, add "Filter Month" to this visual as a filter
Please refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi SBIM ,
Because the date fields that you add to the table visual is consecutive,.
For more details, you can read related document: TOTALMTD function (DAX) - DAX | Microsoft Learn , Total Month to Date(TOTALMTD) DAX function in Power Bi (powerbidocs.com), TOTALMTD – DAX Guide
If you only want to show current month, please try below steps:
1. below is my test table
Table:
Date Table:
create with dax formula:
Date Table = CALENDAR(FIRSTDATE('Table'[Date]),LASTDATE('Table'[Date]))
2. create measure with below dax formula
Total MTD = TOTALMTD(SUM('Table'[Sale]),'Date Table'[Date])Filter Month =
VAR cur_month =
MONTH ( TODAY () )
VAR _m =
MONTH ( SELECTEDVALUE ( 'Date Table'[Date] ) )
RETURN
IF ( cur_month = _m, 1 )
3. add a table visual with fields and measure, add "Filter Month" to this visual as a filter
Please refer the attached .pbix file.
Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.