Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Compare two months dta

Hello all,

 

I am new to Power BI, I have a task to develop a report comparing two months data. 

 

I have a Report_date column and a Account column. Report_Date column has two dates values 202207 and 202208. Account column has various data for both July and August Month. 

 

My task is to compare the months and its accounts, for example conside I have an account called 1234 in july whereas I don't see that account in august then get that 1234 in a separate column. I have to see what accounts were present in July and what accounts left august but was present in July.

 

Thanks

 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    My Sample:

    Here I suggest you to create a measure to filter your account list visual.

     

    Measure = 
    VAR _202207 = CALCULATETABLE(VALUES('Table'[Account]),FILTER('Table','Table'[Date] = 202207))
    VAR _202208 = CALCULATETABLE(VALUES('Table'[Account]),FILTER('Table','Table'[Date] = 202208))
    RETURN
    IF(MAX('Table'[Account]) IN _202207 && NOT(MAX('Table'[Account]) IN _202208),1,0)

     

    Create a table visual by [Account] column, add this measure into visual level filter and set it to show items when value = 1. Result is as below.

     

    Best Regards,
    Rico Zhou

     

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

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Rico Zhou, 

     

    My Date changes everymonth when its October we will have September data in. So that time we have to compare September and August. When its November we would have October data in and that time we have to compare October and September. So everymonth my Date field changes.