Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Dear Team,
I want to calculate a sum of column by selecting the earliest date in a group of multiple fields.
Because the values are redundant on the weekly level, while creating a sum function it is aggregating all the values.
Target is to get for M0 : 135672+289857 and same for other M1 and M2
Here is the example:
Any suggetion what might be helpful ?
@simmi21 , Try Measure
sumx(summarize(Table,Table[Column1], Table[Column2], Table[Column6]),[Column6])
or
calculate(firstnonblankvalue(Table[column1], sum(Table[column6])), allexcept(Table, table[column2]))
Thanks Amit, it helped a bit but not completly.
The sumx(summarize(Table,Table[Column1], Table[Column2], Table[Column6]),[Column6]) works in some cases and in some cases giving wrong results.
Is there a way to get firstnonblankvalue by using combination of two columns ?
In my above sample data set
Combination of column 1 & Column 2 should return a sum of distinct value from column 6.
In SQL term it should be -
select sum(distinct(Column6)) , Column1, Column2 group by column1 & column 2
@simmi21
Are you looking for the earliest date 1st or 3rd column and is the earliest in a month?
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@simmi21 , Not very clear with give data
You can try measures like
firstnonblankvalue(Table[Date], sum(Table[Value]))
or
calculate(firstnonblankvalue(Table[Date], sum(Table[Value])), allexcept(Table, table[group]))
I want to do the sum of Column 6 in my example for the first values only in a combination of Column 1 & 2.
AS Coulmn 1 is a slicer variable and it can have more than one date field. so for a combination of dates from column 1 , Column 2 (M0, M1, M2) should refelect the sum of unique values for a combination of Column 1 & 2
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
13 | |
12 | |
11 | |
11 | |
8 |