Forum Discussion
Morgana_2022
Helper I
4 years agoDax Measure for current month
Hello everybody, i need help on calculating 1 measure in power BI. I have a table with 2 columns: 1 - invoice_date 2 - provided in the invoice_date column there are dates of 2022. (e.g. 0...
amitchandak
Super User
4 years agoMorgana_2022 , I assumed you have date tbale joined with your table
example measure
Based on today
This Month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0)
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))
Today or selection
MTD =
var _max = min(MAX( 'Date'[Date]) , MAXX(allselected('Table'), 'Table'[Sales Date]))
var _min = eomonth(_max,-1)+1 ,
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
This Month =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),0)
var _min = eomonth(_max,-1)+1 ,
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))
eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , Maxx(allselected(Sales), Sales[Date]),0)