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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bsas
Post Patron
Post Patron

Comparation of opp-ty with it's snapshot

Hi PBI Experts,

 

I'll have a problem with comparation of data and do not know if such thing is possible  in PBI.

 

I have 2 sql tables: "opp_ty" and "opp-ty snaphot". Each record in table 1 has unic ID and some other columns. Table 2 has weekly snapshots of opp-ties from table1 (it has the same columns as table1 + date of snapshot). 1 to N.

 

How I can compare original data in record of opp-ty from table1 with it's snapshot data: 1 week before or 2 weeks before of 3 weeks before...etc (week before means snaphot for last week) and show if something change.

4 REPLIES 4
erik_tarnvik
Solution Specialist
Solution Specialist

Hi @bsas,

obviously the answer depends on more specifically what your data looks like and how you want to show the changes, but just to get this started, assume your tables look like this:

opp_ty:
ID	Week	Value
A	4	100
B	4	200
C	4	300

opp_ty snap:
ID	Week	Value
A	1	90
A	2	100
A	3	120
B	1	200
B	2	200
B	3	200
C	1	250
C	2	280
C	3	300

You could then define a measure:

Measure = IF(MAX('opp_ty snap'[Value]) <> MAX(opp_ty[Value]), 
MAX('opp_ty snap'[Value]) - MAX(opp_ty[Value]),
BLANK())

Then create a matrix visual with opp_ty[ID] on the rows, 'opp_ty snap'[Week] on the columns and [Measure] as values. For my sample data set you would then get:

image.png

Meaning, compared to the value in your base table for week 4, B hasn't changed at all and doesn't appear in the table. A had a Value that was 20 higher in week 3, had the same value as now in week 2 and was 10 lower in week 1. And so on. Only your imagination is a limit as to how you would show this though, this is just the simplest representation I could think of.

Thanks @erik_tarnvik,

 

And if I need show comparation (I use table with column "changes", where I show all changes for one opp-ty in one row like: date changed;amount changed;lost) for specific week (value in slicer). Changes probably will be measure.

erik_tarnvik
Solution Specialist
Solution Specialist

Hi @bsas,

can you please provide an example of what you would like the end result to look like?  You mention a slicer on week but at the same time, the snapshots are weekly so are you saying you just want the change as compared to the week before? In addition, displaying changes without also displaying the value that the change is relative to seems less than useful. An example would be extremely useful and save time.

 

Also, what is the definition of "lost"? You already have "changed", what is the difference?

 

In short, I need more specifics in order to be helpful.

@erik_tarnvik please find below exmples

 

Ihave one table with current results:

IDnameclose dateamountstatustype
1opp-110/26/2017 $     10,000.00openforecasted
2opp-210/30/2017 $     50,000.00wonwon
3opp-310/30/2017 $     30,000.00lostlost
4opp-410/26/2017 $       7,000.00openbest case
5opp-510/30/2017 $   440,000.00openforecasted

 

One table with snapshots (they are on weekly basis, one snapshot includes all changes per week)

IDnameclose dateamountstatustypesnapshot date
1opp-110/30/2017 $     50,000.00openbest case10/23/2017
1opp-110/26/2017 $     45,000.00openbest case10/16/2017
1opp-110/26/2017 $     30,000.00openbest case10/9/2017
2opp-210/10/2017 $     65,000.00openforecasted10/23/2017
2opp-210/20/2017 $     65,000.00openbest case10/23/2017
3opp-310/30/2017 $     30,000.00lostbest case10/23/2017

 

what I want to achive when using slicer:

 

week before comparation

 

namechanges
opp-1close date changed to 10/26/2017; amount decreased (-40K);Status changed to Forecasted 
opp-2close dae changed to 10/30/2017;amount increased (+15K);won

 

2 weeks before comparation:

 

namechanges
opp-1amount decreased (-35K);status changed to forecasted
opp-2close dae changed to 10/30/2017;amount increased (+15K);won

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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