Forum Discussion
DanCasSan
5 years agoHelper V
Logic calculation per year
Dear, I have a matrix structured in the following way: in the rows is the description and amount of each concept and in the columns I have the years. What I want to calculate is the ...
Anonymous
5 years agoNot applicable
Hi DanCasSan ,
The pbix file is here.
1.Create a Month table and the MONTH column is sorted by MonthNo column.
MONTH =
ADDCOLUMNS (
DISTINCT ( 'Table'[Date].[MonthNo] ),
"MONTH", FORMAT ( DATE ( 1900, [Date].[MonthNo], 1 ), "MMMM" )
)
2.Create the measure.
Measure =
IF (
ISFILTERED ( 'MONTH'[Month] ),
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( 'Table', FORMAT ( [Date], "MMMM" ) = SELECTEDVALUE ( 'MONTH'[Month] ) )
),
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( 'Table', MONTH ( [Date] ) = MONTH ( TODAY () ) )
)
)
3.If the slicer does not select a month, the current month's data will be displayed. If the month in the slicer is filtered, the data of the filtered month is displayed.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.