Forum Discussion

rui_silva's avatar
rui_silva
Icon for Helper I rankHelper I
8 years ago
Solved

Compare 2 months using Slicer

Hi,

i have a table where i need to compare values from 2 months using slicer, at this moment im using this measure:

Total LM = CALCULATE([nStudents];PREVIOUSMONTH('Month'[Data]) ) when i try to use this measure i dont get any result.

Sample Data

Data                        ClassName     nStudents       Total LM

01/01/2018               ClassA                30                  

01/02/2018               ClassA                25                  -5

 

My Month[Data] its already set as data table if it helps.

At my relationship i have

My class table as * to 1 for Month table.

My class table has IdMonth .

 

Rui Silva

  • Greg_Deckler Thanks for all the help,

    I managed to get solution using a invoked table with dates from 01/01/2018 to 31/12/2018 and its working as i would understand everytime i need to compares dates i cant uses tables i used from myself and need to create a invoked table with dates , etc 

    Thanks ! 

    Rui Silva

7 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    So, the sample data you presented, is that what you want to display as far as the Total LM, but you are not getting that result?

      • Greg_Deckler's avatar
        Greg_Deckler
        Icon for Community Champion rankCommunity Champion

        OK, so is the sample data presented (other than Total LM) represent your source data or are there some calculations going on there? So do you have 1 row for each month in your source data?