Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
44 | |
25 | |
19 | |
16 | |
8 |
User | Count |
---|---|
58 | |
50 | |
44 | |
21 | |
19 |