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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply

Need to Display Last Month of a Year when nothing(i.e., Month) selected from a Slicer

There are 3 Tables related to Head Count. 

1.Act HC

2.Forecast HC

3.Budget HC

 

Each Table have 'Internal Headcount' & 'External Headcount' columns

 

Also each table has 'Quarter' & 'Period'(i.e.,Month) columns but no year column

 

So the task is

1.Need to display Measures for

1.1Act Total HC=Act Int HC + Act Ext HC

1.2FC Total HC=FC Int HC + FC Ext HC

1.3Bud Total HC=Bud Int HC + Bud Ext HC

 

This task I got

 

2.Need to display 'Last Month'(i.e., P12) of a Year from 3 Measures(Act Total HC, FC Total HC & Bud Total HC) when nothing is selected from a 'Slicer'(i.e., Period slicer) 

 

Kindly suggest how to write a measure for this

 

Tried but not getting as expected

 

Thank you

2 REPLIES 2
amitchandak
Super User
Super User

@krishnakantht7 , Assume you have date table, Joined to all these three tables and all these measures are created

 

 

MTD =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , eomonth(today(), -1*month(today()))))
var _min = if(isfiltered('Date'),Min( 'Date'[Date]) , eomonth(today(), -1*month(today()) -1) +1 )
return
CALCULATE([Act Total HC] ,DATESBETWEEN('Date'[Date],_min,_max))

Hi Amitchandak, 

 

Thank you for the solution. 

Without date table, will it be possible to write the measure

As they have given columns like Quarter & Period columns from the 3 tables(No year column & Date column) & a seperate calendar table

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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