Forum Discussion

krrish116's avatar
krrish116
Resolver II
5 years ago
Solved

Default Graph should show only current month data..

Hi @amitchandak ,

 

Please help me to sort it out..

The Graph by default has to show only March Site Data ...

 

I had a table with 4 columns  

Date                    Site           Sceneario      Position

20-01-2020         PP              Gifferal           28

20-02-2021         CP             Referral           80

22-02-2021         OP             Gifferal            75

01-03-2021         GP             Referral            24

02-03-2021         QP            Coferral             43

................................................

In the graph

Im showing

Site on Shared Axis 

Position on Column Values

 

Now in this Graph i have to show only present month data.

 

_________________________________________

Answer from ur end:

is filtered should help

Assume MTD using the Date table

All measures below

measure = SUM(Table[position])

MTD = CALCULATE([measure],DATESMTD('Date'[Date]))

Filtered Month = if(isfiltered(Date[Date]), [measure],[MTD])

___________________________________________________________________

By using the above measure im getting values for current month(i.e., March 2021) and if that site doesnt have March month data and it has data only till Dec 2020 then that site is showing values of Dec2020 in that Graph.

But here i have to show only march data and if i select any month from month slicer then the values change.

Please help me in sorting out this.

Thanks,

Krish...

  • krrish116 , based on what I got.

    It can show data of march in these case.

    Your calendar/date tbale  end on march (with not date this will work)

     

    date = calendar(date(2017,01,01), today())

     

    or

     

    date = calendar(date(2017,01,01), eomonth(today(),0))

     

     

    Or create a flag in date table and select this Month

    https://youtu.be/hfn05preQYA

     

    Month Type = Switch( True(),
    eomonth([Date],0)= eomonth(Today(),0),"Current Month" ,
    Format([Date],"MMM-YYYY")
    )

     

1 Reply

  • krrish116 , based on what I got.

    It can show data of march in these case.

    Your calendar/date tbale  end on march (with not date this will work)

     

    date = calendar(date(2017,01,01), today())

     

    or

     

    date = calendar(date(2017,01,01), eomonth(today(),0))

     

     

    Or create a flag in date table and select this Month

    https://youtu.be/hfn05preQYA

     

    Month Type = Switch( True(),
    eomonth([Date],0)= eomonth(Today(),0),"Current Month" ,
    Format([Date],"MMM-YYYY")
    )