Forum Discussion
Tableau Function to Power BI
- 1 year ago
Hi Anonymous try the below measure and let me know if it helps.
MonthlyAvgAmountMeasure =
VAR FilteredTable =
FILTER (
ALL ( 'Table' ),
'Table'[Frequency] = "Monthly"
&& NOT ISBLANK ( 'Table'[Closed Date] )
)
RETURN
AVERAGEX (
SUMMARIZE (
FilteredTable,
'Table'[Work Item ID],
'Table'[Savings],
'Table'[Frequency],
"CalcVal", DATEDIFF ( 'Table'[Closed Date], TODAY(), MONTH ) * 'Table'[Amount]
),
[CalcVal]
)
Hi Anonymous try the below measure and let me know if it helps.
MonthlyAvgAmountMeasure =
VAR FilteredTable =
FILTER (
ALL ( 'Table' ),
'Table'[Frequency] = "Monthly"
&& NOT ISBLANK ( 'Table'[Closed Date] )
)
RETURN
AVERAGEX (
SUMMARIZE (
FilteredTable,
'Table'[Work Item ID],
'Table'[Savings],
'Table'[Frequency],
"CalcVal", DATEDIFF ( 'Table'[Closed Date], TODAY(), MONTH ) * 'Table'[Amount]
),
[CalcVal]
)