Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hello guys, im super new on this and i tried to find the solution online without success.
The situation is the following:
We have many items produced by date, on the example below i have the pallet count and i need it to be deducted from previous if the date is the same:
So basically, if is the same date, the following row should deduct from previous on pallet count.
Is there anyway to accomplish this?
Thank you
Solved! Go to Solution.
@MjoGehri
You need to add an index column to your table in Power Query first then add the following column using DAX:
New Count =
VAR __CURRINDEX = 'Table6'[Index]
VAR __CURRDATE = 'Table6'[Date]
VAR __PREVDATE = MAXX( FILTER( 'Table6', Table6[Index] = __CURRINDEX - 1) , 'Table6'[Date] )
VAR __CURRAMT = 'Table6'[Count]
VAR __PREVAMT = MAXX( FILTER( 'Table6', Table6[Index] = __CURRINDEX - 1) , 'Table6'[Count] )
RETURN
SWITCH(
TRUE(),
__CURRDATE = __PREVDATE , __CURRAMT - __PREVAMT,
__CURRAMT
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@MjoGehri
You need to add an index column to your table in Power Query first then add the following column using DAX:
New Count =
VAR __CURRINDEX = 'Table6'[Index]
VAR __CURRDATE = 'Table6'[Date]
VAR __PREVDATE = MAXX( FILTER( 'Table6', Table6[Index] = __CURRINDEX - 1) , 'Table6'[Date] )
VAR __CURRAMT = 'Table6'[Count]
VAR __PREVAMT = MAXX( FILTER( 'Table6', Table6[Index] = __CURRINDEX - 1) , 'Table6'[Count] )
RETURN
SWITCH(
TRUE(),
__CURRDATE = __PREVDATE , __CURRAMT - __PREVAMT,
__CURRAMT
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
User | Count |
---|---|
64 | |
59 | |
47 | |
33 | |
32 |
User | Count |
---|---|
84 | |
75 | |
56 | |
50 | |
44 |