Forum Discussion

bideveloper555's avatar
4 years ago
Solved

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
  • 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

2 Replies

  • 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