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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bideveloper555
Helper IV
Helper IV

Card Visual MoM with Default Month (current Month)

hi

1. i created measure Month over month and which is working fine on table.(months name,mom%)

2.when i select using date as slicer table works. still good.

 

 but i want to create Card visual to show only current month MoM.(dec 2021)

i did create extra custom column 

IsCurrentMonth = IF(MONTH ( NOW () ) = MONTH ( DateColumn)
&& YEAR ( NOW () ) = YEAR ( DateColumn ),
"Current Month",
FORMAT(Datecolumn,"mmm"))
When i used IsCurrentMonth as slicer, table doesnt work and Card too.
 
what i want to achive:
Card Visual MoM for Current Month with out any slicers.
eg: Dec vs Nov change as of today.(01/12/2021)
 
Thanks
V
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@bideveloper555 , You can use measures like these based on date and then take a diff

 

MTD=
var _min = eomonth(today(),-1)+1
var _max = today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )


LMTD =
var _min = eomonth(today(),-2)+1
var _max1 = today()
var _max = date(year(_max1),month(_max1)-1, day(_max1))
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )

This month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0) //today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )


Last month Today =
var _min = eomonth(today(),-2)+1
var _max = eomonth(today(),-1) //today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )

Last to last month Today =
var _min = eomonth(today(),-3)+1
var _max = eomonth(today(),-2) //today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )

 

 

All About Time Intelligence around Today: https://youtu.be/gcLhhxhXKEI

View solution in original post

2 REPLIES 2
bideveloper555
Helper IV
Helper IV

Thank you @amitchandak 🙂

amitchandak
Super User
Super User

@bideveloper555 , You can use measures like these based on date and then take a diff

 

MTD=
var _min = eomonth(today(),-1)+1
var _max = today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )


LMTD =
var _min = eomonth(today(),-2)+1
var _max1 = today()
var _max = date(year(_max1),month(_max1)-1, day(_max1))
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )

This month Today =
var _min = eomonth(today(),-1)+1
var _max = eomonth(today(),0) //today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )


Last month Today =
var _min = eomonth(today(),-2)+1
var _max = eomonth(today(),-1) //today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )

Last to last month Today =
var _min = eomonth(today(),-3)+1
var _max = eomonth(today(),-2) //today()
return
CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )

 

 

All About Time Intelligence around Today: https://youtu.be/gcLhhxhXKEI

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.