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.
Hi, people.
I need to create a "caculated column", if possible" with the last invoice number from previous month.
Example Data
let
Fonte = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fY9LCsMwDAWvUrwO+EmyPu5VQu5/jdh1MRSU7rQY5o3Os5CJG5ejULCr0bjYK7wymF7AGyjX8cMZ2H1yqIiUk+3jv77FmbTWJieJj9V1RpF31T4xaKLbWLQeTI+2YbEVh4jPKGe2jY1NrK8TWwi1b5uNgKe2jYUC0LTtugE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [CustomerID = _t, #"Invoice Number" = _t, Date = _t]),
#"Tipo Alterado" = Table.TransformColumnTypes(Fonte,{{"CustomerID", Int64.Type}, {"Invoice Number", Int64.Type}, {"Date", type datetime}})
in
#"Tipo Alterado"
Any ideias?
Solved! Go to Solution.
Hi, @CSpina
You can take a try the following formula.
Result =
CALCULATE (
MAX ( Query1[Invoice Number] ),
FILTER (
Query1,
Query1[CustomerID] = EARLIER ( Query1[CustomerID] )
&& Query1[Date] <EARLIER(Query1[Date])
)
)
If it doesn't meet your requirement,please share your expected result in excel.
Best Regards,
Community Support Team _ Eason
Hi, @CSpina
You can take a try the following formula.
Result =
CALCULATE (
MAX ( Query1[Invoice Number] ),
FILTER (
Query1,
Query1[CustomerID] = EARLIER ( Query1[CustomerID] )
&& Query1[Date] <EARLIER(Query1[Date])
)
)
If it doesn't meet your requirement,please share your expected result in excel.
Best Regards,
Community Support Team _ Eason
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
69 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |