March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I need help with comparing evolution of the same data across different snapshots from a data source. I am simplifying my example.
Everyday I get a snapshot of invoice data in a csv file. I import the data in the same table tblInvoice:
InvoiceID
InvoiceAmount
InvoiceStatus
LogID
Each dataload get a LogID.
Consequently I have a Logtable with
LogID
LogTimestamp
LogRank = RANK.EQ(Log[LogID],Log[LogID],DESC) --- making sure I always can filter for the latest Log
I have some measures, e.g
TotalAmount:= Calculate(SUM(tblInvoice[InvoiceAmount]))
InvoiceCount = Calculate(Countrows(tblInvoice))
I also have a date table.
I want to be able to compare e.g. the relative InvoiceCount between e.g. LogRank 1 and 2. The business value of this is to understand the development in invoice status across time. Any suggestions?
Solved! Go to Solution.
In my opinion you can create a calculated table to get the rank 1and 2 invoices. Make sure there's a many to one relationship between Invoices and LogTable.
Top2LatestLoadedData = CALCULATETABLE(Invoices,TOPN(2,LogTable,LogTable[LogRank ]))
Then apply your measure against this table.
TotalAmount= Calculate(SUM(Top2LatestLoadedData[InvoiceAmount])) InvoiceCount = Calculate(Countrows(Top2LatestLoadedData))
In my opinion you can create a calculated table to get the rank 1and 2 invoices. Make sure there's a many to one relationship between Invoices and LogTable.
Top2LatestLoadedData = CALCULATETABLE(Invoices,TOPN(2,LogTable,LogTable[LogRank ]))
Then apply your measure against this table.
TotalAmount= Calculate(SUM(Top2LatestLoadedData[InvoiceAmount])) InvoiceCount = Calculate(Countrows(Top2LatestLoadedData))
hi @nhoff
An idea
Measure =
VAR LOGRANKER=Max(Logs[LogRank])-1
RETURN
[InvoiceCount]-CALCULATE(Invoices[InvoiceCount];FILTER(all(Logs);Logs[LogRank]=LOGRANKER))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |