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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SteveRB
Frequent Visitor

Compare data with previous period/last month

Hello i've looked through many posts, and i am unable to find a solution to my issue.

 

I have a table that is presenting reporting %'s

 

I want to be able to present the same Report Form against the previous month.

 

Steps i have taken so far, i have created a date table (see below)

Capture.PNG

I have linked it up with my table, using the month number

 

This is my table with the data in, i need to show on a graph the previous month's data. I.E Feb E2B Drug  vs Jan E2B drug?

 

compare.PNG

 

If i include the report forms as a filter, they stack up the month's rather than split them as two individual figures on a graph?

 

Any solution will greatly be appreciated

 

Thanks

 

 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@SteveRB,

 

You could first add a calculated column.

Prev =
LOOKUPVALUE (
    Table1[% on time],
    Table1[Report Form], Table1[Report Form],
    Table1[Monthno], DATE ( YEAR ( Table1[Monthno] ), MONTH ( Table1[Monthno] ) - 1, 1 )
)
Community Support Team _ Sam Zha
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

6 REPLIES 6
v-chuncz-msft
Community Support
Community Support

@SteveRB,

 

You could first add a calculated column.

Prev =
LOOKUPVALUE (
    Table1[% on time],
    Table1[Report Form], Table1[Report Form],
    Table1[Monthno], DATE ( YEAR ( Table1[Monthno] ), MONTH ( Table1[Monthno] ) - 1, 1 )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello, thanks your reply.

 

I've used the steps as advised and recieve the following error message

 

To be clear, i am trying to compare the data that is in the same table, I.E January E2B against Feb's?

 

I may have gone wrong somewhere, i'm really new to Dax, so can't really troubleshoot that well.

 

lookup.PNG

@SteveRB,

 

Take a close look at the third parameter.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks, slowly getting there :). I think

 

jan not textPNG.PNG

 

How do i get around this? I typed in excel 01/01/2017 and Power Bi changes it to 1 January 2017?

@SteveRB,

 

Again, take a closer look at the formula. To change the format, you may select the column and then use the Format drop-down menu from Modeling tab.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Just to add further clarification and understanding of my issue

 

The below screenshot, is showing two months of E2B data however they are collating into the one column rather than splitting across the months

 

My aim is to get them split across the two month.

 

two months.PNG

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.