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
How is it going:
Along with greeting colleagues, I need to generate a measure that returns me to the "Total Sales" without accounting for those made on the first sale date that a seller has. I am using a Table visualization. I have the idea of capturing the minimum date for each seller using a VARIABLE, but I can't figure out how to use it later, so I get stuck.
I hope you will help me. In advance, thank you very much!.
In the case of the Seller of code 121, I do not want the sale made on "December 11, 2018" to be accounted for. And so for every seller.
Solved! Go to Solution.
@Syndicate_Admin , Try like
Measure =
VAR __id = MAX ('Table'[Seller ID] )
VAR __date = CALCULATE ( MIN('Table'[counter] ), ALLSELECTED ('Table' ), 'Table'[Seller ID] = __id )
CALCULATE ( Sum ('Table'[Sales] ), VALUES ('Table'[Seller ID] ),'Table'[Seller ID] = __id,'Table'[counter] = __date )
Or
sumx(Table, Firstnonblank(Table[Date], sum(Tables[Sales])))
or
Calculate(sumx(Table, Firstnonblank(Table[Date], sum(Tables[Sales]))), allexcept(Table, Table[seller id]))
refer
https://www.linkedin.com/pulse/five-recent-power-bi-functions-you-should-use-more-often-amit-chandak
Hi @Syndicate_Admin ,
I think the suggestion provided by @amitchandak and @Ashish_Mathur are worth a try. Please give feedback even on the results of the test. If the problem has been solved, please mark the correct response as the standard answer to help the other members find it more quickly.
If the problem persists, please specify and provide the test data (remove sensitive information). I will get back to you as soon as possible.
Best Regards,
Henry
Hi,
Try this pattern
Date of first interaction = calculate(min(sales[date]),daesbetween(calendar[date],minx(all(calendar),calendar[date]),max(calendar[date])))
Total sale = sum(sales[value])
Total sale after first date = calculate([total sale],filter(values(Customers[Customer name]),sales[date]>[date of first interaction]))
To your visual, drag Year and Month name from the Calendar Table. Drag the last measure to the visual.
If this does not help, then share the link from where i can download your PBI file.
@Syndicate_Admin , Try like
Measure =
VAR __id = MAX ('Table'[Seller ID] )
VAR __date = CALCULATE ( MIN('Table'[counter] ), ALLSELECTED ('Table' ), 'Table'[Seller ID] = __id )
CALCULATE ( Sum ('Table'[Sales] ), VALUES ('Table'[Seller ID] ),'Table'[Seller ID] = __id,'Table'[counter] = __date )
Or
sumx(Table, Firstnonblank(Table[Date], sum(Tables[Sales])))
or
Calculate(sumx(Table, Firstnonblank(Table[Date], sum(Tables[Sales]))), allexcept(Table, Table[seller id]))
refer
https://www.linkedin.com/pulse/five-recent-power-bi-functions-you-should-use-more-often-amit-chandak
Dear Amitchandak,
Thanks a lot! for your help so fast, I will test the code and tell you how it goes!
🙏
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |