Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
JuanBolas
Helper II
Helper II

Cards for current month only

I'm a newbie and I need some help.

 

I'm displaying an income statement sliced by two months using the chiclet slicer.  The subtotal rows are calculated using running total measures.  This is the case of Revenue.

 

I need to display the Revenue ("Ingresos Brutos" line) only for the current month (ie: the max date in the fecha field in the 'Actual' table.  My current measure (Total Actual) only shows me all of the displayed months.

 

My PBIX is here: https://drive.google.com/file/d/1pThZIX9B0IpD-PNVngHB-B3xA48p8HRv/view?usp=sharing

 

Thanks in advance.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@JuanBolas , Selected date of today

 

MTD =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
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))

 

 

only based on today

 

 

This Month =
var _max = eomonth(today(),0) 
var _min = eomonth(_max,-1)+1 ,
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

View solution in original post

2 REPLIES 2
JuanBolas
Helper II
Helper II

Thank you @amitchandak 

amitchandak
Super User
Super User

@JuanBolas , Selected date of today

 

MTD =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
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))

 

 

only based on today

 

 

This Month =
var _max = eomonth(today(),0) 
var _min = eomonth(_max,-1)+1 ,
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.