Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I am trying to come up with a formula that will visually show only the total of one row on the first occurance in a table. I know this can be done in a matrix, but I need it to be a table. Below is my table which I am summing Sales for an Account. I have multiple Contracts with differing sales values, however I want the total sales (Sum Sales) to only show up in the first occurance of the contract start date and the subsequent fields for each additional contract start to be null. Can this be achieved?
Thank you!
Account | Contract | Sales | Contract Start | Sum Sales |
Account A | Contract A | 100 | 3/6/2025 | 1000 |
Account B | Contract B | 200 | 3/7/2025 | 200 |
Account C | Contract C | 300 | 3/8/2025 | 300 |
Account A | Contract B | 400 | 3/9/2025 | |
Account A | Contract C | 500 | 3/10/2025 |
Solved! Go to Solution.
@amby0430 I thought you wanted it by Account and Contract ID. If you only want it by Account:
Sum Sales Measure =
VAR __Account = MAX( 'Table'[Account] )
VAR __Date = MAX( 'Table'[Contract Start] )
VAR __Table = FILTER( ALL( 'Table' ), [Account] = __Account )
VAR __MinDate = MINX( __Table, [Contract Start] )
VAR __Result = IF( __Date = __MinDate, SUMX( __Table, [Sales] ), BLANK() )
RETURN
__Result
It is generally helpful if you explain why something didn't work versus "did not work" as the latter isn't exactly helpful in determining what is wrong with the proposed solution. Just FYI.
@amby0430 Try:
Sum Sales Measure =
VAR __Account = MAX( 'Table'[Account] )
VAR __Contract = MAX( 'Table'[Contract] )
VAR __Date = MAX( 'Table'[Contract Start] )
VAR __Table = FILTER( ALL( 'Table' ), [Account] = __Account && [Contract] = __Contract )
VAR __MinDate = MINX( __Table, [Contract Start] )
VAR __Result = IF( __Date = __MinDate, SUMX( __Table, [Sales] ), BLANK() )
RETURN
__Result
Unfortunately it did not work. Updating based on your comments. My apologies, I am just beginning to use the forum more in my work. I will take this into the account in the future, however with the above the result was
Account | Contract | Contract Start | Sum of Sales | Sum Sales Measure |
Account A | Contract A | 3/6/2025 0:00 | 100 | 100 |
Account A | Contract B | 3/9/2025 0:00 | 400 | 400 |
Account A | Contract C | 3/10/2025 0:00 | 500 | 500 |
Account B | Contract B | 3/7/2025 0:00 | 200 | 200 |
Account C | Contract C | 3/8/2025 0:00 | 300 | 300 |
@amby0430 I thought you wanted it by Account and Contract ID. If you only want it by Account:
Sum Sales Measure =
VAR __Account = MAX( 'Table'[Account] )
VAR __Date = MAX( 'Table'[Contract Start] )
VAR __Table = FILTER( ALL( 'Table' ), [Account] = __Account )
VAR __MinDate = MINX( __Table, [Contract Start] )
VAR __Result = IF( __Date = __MinDate, SUMX( __Table, [Sales] ), BLANK() )
RETURN
__Result
It is generally helpful if you explain why something didn't work versus "did not work" as the latter isn't exactly helpful in determining what is wrong with the proposed solution. Just FYI.
This solution worked. Below is the result. Thank you!
Account | Contract | Contract Start | Sum of Sales | Sum Sales Measure |
Account A | Contract A | 3/6/2025 0:00 | 100 | 1000 |
Account A | Contract B | 3/9/2025 0:00 | 400 | |
Account A | Contract C | 3/10/2025 0:00 | 500 | |
Account B | Contract B | 3/7/2025 0:00 | 200 | 200 |
Account C | Contract C | 3/8/2025 0:00 | 300 | 300 |