Forum Discussion

dofrancis3's avatar
dofrancis3
Icon for Resolver I rankResolver I
2 years ago
Solved

Display Previosly value date

Dear Colleagues could you help me with DAX Mesure! As per the table below, i would like to disply separtly "Current" and "Previously" percentage of each country   Exemple for CD  % % Previo...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Your solution is great sanalytics , Allow me to offer another insight:

    Hi, dofrancis3 

    Based on your description, I used the following sample data:

    To make it more realistic for you, I've created a measure using a percentage column.

    I created two measures using the following two DAX expressions.

    Current Percentage = 
    VAR MaxDate = CALCULATE ( MAX ( 'Table'[Date]), ALLEXCEPT('Table','Table'[Country] ))
    RETURN
    CALCULATE (
        [PercentageMeasure],
        'Table'[Date] = MaxDate
    )
    Previous Percentage = 
    VAR MaxDate = CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT('Table','Table'[Country] ))
    VAR PrevDate = CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT('Table','Table'[Country] ), 'Table'[Date] < MaxDate )
    RETURN
    CALCULATE (
        [PercentageMeasure],
        'Table'[Date] = PrevDate
    )

    Here are the results:

     

    I've provided the PBIX file used this time below.

     

     

    How to Get Your Question Answered Quickly

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Jianpeng Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.