Previous Month vs This Month Top 1 values

Hi All,

I like to use dax to find top 1 supplier in my dataset for this month and previous month i.e.

  1. How much that was spend
  2. Name of the supplier.

I was able to get desired results for “This Month” as explained above. Also for “Previous month” Top 1 spend, I got right result but got incorrect result for “Previous Month” NAME of supplier.

DAX - Name of Supplier ( last Month) comes back with incorrect result

Top SupplierName LM =
MAXX(
TOPN(1,
SUMMARIZE(
Combined,
Combined[SupplierName],
“Spend”, [Spend LM] ),
[Spend],DESC),
Combined[SupplierName] )

DAX - Supplier Spend ( last Month) correct result

Top SupplierSpend LM =
MAXX(
TOPN(1,
SUMMARIZE(
Combined,
Combined[SupplierName],
“Spend”, [Spend LM] ),
[Spend],DESC),
[Spend LM] )

Thank you