Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Request for DAX Help

Dear All,  I request help to solve a scenario.  I have a input table, using that I need to create a output report (Refer tables below). I am having trouble in creating the dax formulas for columns S...
  • Phil_Seamark's avatar
    Phil_Seamark
    8 years ago

    Hi Anonymous

     

    I think I see what you are after.  Please try the following three calculated measures.  I have attached a simple PBIX file that contains the measures.

     

    Shares Count Current Year = 
    VAR myDate = TODAY()
    RETURN 
        SUMX(
            FILTER(
                'Table1',
                'Table1'[Validfrom] <= myDate &&   
                'Table1'[Validto] >= myDate
            ),
           'Table1'[Sharecount]
           )
    Shares Count Previous Year = 
    VAR myDate = EDATE(TODAY(),-12)
    RETURN 
         SUMX(
            FILTER(
                'Table1',
                'Table1'[Validfrom] <= myDate &&   
                'Table1'[Validto] >= myDate
            ),
           'Table1'[Sharecount]
           )
    Difference = [Shares Count Current Year] - [Shares Count Previous Year]