cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Morgana_2022
Helper I
Helper I

Dax 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. 01/02/2022, 05/03/2022, 07/08/2022, 22/10/2022 ...)

if I wanted calculate the provided of the current month, in an absolute way?
How can I do?

Thanks in advance!
Please help me!
Erika

2 REPLIES 2
Morgana_2022
Helper I
Helper I

Hi!
No, I have a single table with invoice_date and provided.
Is there a dax formula that works (like this one below) but which calculates the provided only for the current month absolutely?

PROVIDED CY = CALCULATE (sum ('table' [provided]), YEAR ('table' [invoice_date]) = YEAR (TODAY ()))

amitchandak
Super User
Super User

@Morgana_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)

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors