Forum Discussion

admin11's avatar
admin11
Memorable Member
5 years ago
Solved

How to replace 2 GL expense expression into 1 ?

Hi All

 

I have make a post below  :-

https://community.powerbi.com/t5/Desktop/Convert-previous-month-expression-to-last-month-not-working/m-p/1733897#M683513

 

with the help from  jdbuchanan71  i get the below expression working fine :-

 

Current month - 1 EXP_ =
VAR _Start = EOMONTH ( TODAY (), -2 ) + 1
VAR _End = EOMONTH ( _Start, 0 )
RETURN
CALCULATE ( [AMOUNT_EXP], DATESBETWEEN ( 'Date'[Date], _Start, _End ) )
 
Current month - 2 EXP_ =
VAR _Start = EOMONTH ( TODAY (), -3 ) + 1
VAR _End = EOMONTH ( _Start, 0 )
RETURN
CALCULATE ( [AMOUNT_EXP], DATESBETWEEN ( 'Date'[Date], _Start, _End ) )
 

May i know how to convert the above expression into 1 , So user need only click on the  :-

month = 2 , get Current month - 1 EXP_ 

month = 1 , get Current month - 2 EXP_ 

 

 

Enclosed below is my PBI file :-

https://www.dropbox.com/s/j2vletdewwpeqkj/PBT_V2021_392%20TI_SI_GL%20how%20to%20combine%202%20expression%20into%201%20user%20click%20on%20month.pbix?dl=0

 

Paul

 

 

2 Replies