Forum Discussion
PijushRoy
3 years agoCommunity Champion
Two DAX calculated column needed for calculate returning customer series and no of invoice
Hi Team, I have data like below (from column 1 to 3) and I need to create two calculated column for 4 and column 5
PBIX file attached for sample data and two require column
Thanks in...
- 3 years ago
Hi PijushRoy ,
Redo the calculation to:
CUST SERIES = VAR MAXINVOICE = IF ( Data[Hown Many Invoices] = 1, Data[Index],Data[Index]+ Data[Hown Many Invoices]-1 ) RETURN IF ( Data[Hown Many Invoices] <> BLANK (), Data[Invoice_ID] & "-" & MAXX ( FILTER ( ALL ( Data ), Data[Index] = MAXINVOICE ), Data[Invoice_ID] ) )
vanessafvg
3 years agoCommunity Champion
its not perfect but its a something to work with i needs more tweaking
Get UniqueCust =
VAR mininvoiceid =
MIN ( Data[Invoice_ID] )
VAR maxindex =
IF (
SUM ( Data[Index] ) > 1,
CALCULATE (
MIN ( Data[Index] ) - 1,
ALL ( data ),
Data[Invoice_ID] > mininvoiceid
&& Data[Unique_Cust] > 1
),
BLANK ()
)
VAR maxinvoiceid =
CALCULATE ( MAX ( Data[Invoice_ID] ), ALL ( data ), Data[Index] = maxindex )
RETURN
mininvoiceid & "-"
& IF ( ISBLANK ( maxinvoiceid ), mininvoiceid, maxinvoiceid )
PijushRoy
3 years agoCommunity Champion
vanessafvg
Thanks for your help, however it is not working and not shoiwng correct result.
- vanessafvg3 years agoCommunity Champion
as i said it needs tweaking. however agree providing more information might be useful as the in expected result for each row.