The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello everyone!
I maintain a table weekly in that way that I add one snapshot of a specific per week. The objective is to get an archive.
The structure is like that:
Date | Order |
08.02.2021 | 1001 |
08.02.2021 | 1002 |
08.02.2021 | 1003 |
15.02.2021 | 1001 |
15.02.2021 | 1002 |
15.02.2021 | 1003 |
15.02.2021 | 1004 |
Now I would like to determine how many new rows/ new orders are now in the current week compared to last week.
I already have linked that table to my calendar and attribute table. I would like to use a department dimension (attribute list) to see in the end the result in a matrix/ table.
To get the entries per week I have added these measures:
#Orders =
CALCULATE (
DISTINCTCOUNT( 'Orders'[Order] ))
#Orders Prio Week =
CALCULATE (
[#Orders],
DATEADD('Calendar'[Date], -7, DAY))
Entry #Orders =
VAR _Entry = IF([#Orders]<>1,BLANK(), [#Orders] - [#Orders Prio Week])
RETURN
_Entry
Somehow I get a blank value as a result for the last measure If I put the department into the rows section.
What is missing here?
Use the EXCEPT() function to figure out the differences between snapshots
Let's assume the previous snapshot is A and the current snapshot is B
EXCEPT(B,A) will give you all the orders that are new this week
EXCEPT(A,B) will give you all the orders that are no longer listed in the current snapshot (not sure if you have such a situation)
INTERSECT(A,B) will give you the orders that are present in both snapshots.
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
8 | |
8 |