Forum Discussion
Sum values with latest dates per year
- 3 years ago
Hi,
Please check the below pictures and the attached pbix file.
I suggest unpivotting a table like below, and then add [Year] column like below.
After loading the table into Power BI, create a measure like below, and put it into a matrix visualization.
- 3 years ago
Hi,
Thank you for your feedback.
Please check the below picture and the attached pbix file, that I added one more measure to fix the total row in the visualization.
Hi,
Please check the below pictures and the attached pbix file.
I suggest unpivotting a table like below, and then add [Year] column like below.
After loading the table into Power BI, create a measure like below, and put it into a matrix visualization.
- CJKPowerBI3 years ago
Helper I
thank you Jihwan_Kim the measure worked great.......
i have another question, how can i sum per year as now the "Row Subtotals" only sees the latest date and doesn consider the previous ones... see below
- Jihwan_Kim3 years ago
Super User
Hi,
Thank you for your feedback.
Please check the below picture and the attached pbix file, that I added one more measure to fix the total row in the visualization.
- CJKPowerBI3 years ago
Helper I
hello Jihwan_Kim
can we modify the below measures (they are your above measures but with different tables and columns names):
1)
Total per column per year: = sumx(ADDCOLUMNS(SUMMARIZE('Family situation PowerBI','Family situation PowerBI'[Institution],'Family situation PowerBI'[Date].[Year]),"@result",[ValueLatestDate(all Years)]),[@result])2)ValueLatestDate(all Years) = Var Max_Date = MAX('Family situation PowerBI'[Date])Var Latest_Value = CALCULATE(SUM('Family situation PowerBI'[Amount]),'Family situation PowerBI'[Date]=Max_Date)return Latest_Valueto both include all the values from the current year...thank you
- CJKPowerBI3 years ago
Helper I
this is Jihwan_Kim its exactly what i needed... thank you