Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Power Bi Family!
I need to identify the number of orders after the last claim submission date to today.
I have an orders table (fact table) where all orders are populated. In the orders table, I have the unique order ids and the date of each order. My idea is to count the order ids or the order dates after the last claim submission. I just confused on what measure to use.
ANy help is much appreciated!
Solved! Go to Solution.
Hi @Andrew_na_lang ,
I created some data:
CustomerTable:
Table:
Here are the steps you can follow:
1. Create measure.
Flag =
var _max1=MAXX(FILTER(ALL(CustomerTable),'CustomerTable'[Customer]=MAX('Table'[Customer])),'CustomerTable'[Date])
return
IF(
MAX('Table'[Date])>_max1,1,0)Sum =
SUMX(FILTER(ALL('Table'),'Table'[Customer]=MAX('Table'[Customer])&&'Table'[ID]>=MIN('Table'[ID])),[Flag])Measure =
IF(
[Sum] <>0,[Sum]&" "&"time","No more than")
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Andrew_na_lang ,
I created some data:
CustomerTable:
Table:
Here are the steps you can follow:
1. Create measure.
Flag =
var _max1=MAXX(FILTER(ALL(CustomerTable),'CustomerTable'[Customer]=MAX('Table'[Customer])),'CustomerTable'[Date])
return
IF(
MAX('Table'[Date])>_max1,1,0)Sum =
SUMX(FILTER(ALL('Table'),'Table'[Customer]=MAX('Table'[Customer])&&'Table'[ID]>=MIN('Table'[ID])),[Flag])Measure =
IF(
[Sum] <>0,[Sum]&" "&"time","No more than")
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@ribisht17 Is there a way to get the same result without merging the tables? I am working on a huge dataset and not ideal to merge them.
If you are using Column then use EARLIER instead of MAX
OR if it is still not working?
Is it possible to share the sample PBIX, difficult to say it from here?
Regards,
Ritesh
@ribisht17 I cannot share the pbx file, for it contains customer information.
Trying to simplify it ,
Step 1. Create a Column on your Order Table to Get the Customer's Last Claim Date
@ribisht17 I did this.
On my customer's table, I created a new column -
Sample data is needed for both the tables so that solution can be provided, but I created a column on Orders, not Customers.
You can see what I did, last tab COUNT - Google Drive
You should be able to do that even without merging,logic remains the same, I can relate the table and do the same thing, did you try ?
Regards,
Ritesh
Hey Man @ribisht17,
Yes, I tried this measure as a calculated column. It was just loading and takes time to show results.
There might be something off with my measure though.
Customer
| Customer ID | Last Claim Sub Date |
| 1 | 01-01-2022 |
| 2 | 02-01-2022 |
| 3 | 03-01-2022 |
| 4 | 04-01-2022 |
Order
| Order ID | Order Date | Customer ID |
| 1 | 02-01-2022 | 1 |
| 2 | 03-01-2022 | 1 |
| 3 | 04-01-2022 | 2 |
| 4 | 02-01-2022 | 2 |
I had to generate some data on my own, I did create 2 tables and merged it
As you can see Customer 1 ordered twice after the last day whereas Customer 2 ordered only once
This is the calculation I did use here,
Additional Information...
This is my customer table which has a column that shows the last claim submission date.
Below is my orders table which has the unique order ids and the time created id (when the order was submitted).
Basically, I need to know if the customer still submitted another order after the last claims submission date from my customer's table, and if yes, how many orders (count) were submitted after the last claims submission date to date.
@ribisht17
This is my customer table which has a column that shows the last claim submission date.
Below is my orders table which has the unique order ids and the time created id (when the order was submitted).
Basically, I need to know if the customer still submitted another order after the last claims submission date from my customer's table and if yes, how many orders where submitted after the last claims submission date to date.
Post some data, please
Regards,
Ritesh
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |