Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
dofrancis3
Resolver I
Resolver I

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 %
% Previously date60%
% Max date:100%

 

Country       Date       %

CD05/02/202395%
MU11/07/202322%
CD18/12/202360%
CD23/02/2024100%
MU02/05/202417%
1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

Hi, @dofrancis3 

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

vjianpengmsft_0-1716261200102.png

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

vjianpengmsft_2-1716261311691.png

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:

vjianpengmsft_3-1716261462315.png

 

vjianpengmsft_4-1716261474339.png

vjianpengmsft_5-1716261485193.png

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.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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

Hi, @dofrancis3 

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

vjianpengmsft_0-1716261200102.png

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

vjianpengmsft_2-1716261311691.png

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:

vjianpengmsft_3-1716261462315.png

 

vjianpengmsft_4-1716261474339.png

vjianpengmsft_5-1716261485193.png

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.

sanalytics
Super User
Super User

@dofrancis3 

 

You can try below measure

Previous Value = 
 CALCULATE(
     SUM( 'Table'[Perc] ),
     OFFSET(
        -1,
         SUMMARIZE( ALL( 'Table' ),'Table'[Country],'Table'[Date], 'Table'[MaxTag] ),
         ORDERBY( 'Table'[Date], ASC ),PARTITIONBY('Table'[Country] )
     ) )

sanalytics_0-1716220510655.png

 

Hope it helps.

 

Regards

sanalytics

Dear @sanalytics thank you for your suport !

But please how can i do in case the % column is a Mesure? 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.