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
Please try the below measure:
MonthlyAmountCalc =
IF (
SELECTEDVALUE('Table'[Frequency]) = "Monthly",
AVERAGEX (
SUMMARIZE (
'Table',
'Table'[Work Item ID],
'Table'[Savings],
'Table'[Frequency],
"CalculatedValue", DATEDIFF('Table'[Closed Date], TODAY(), MONTH) * 'Table'[Amount]
),
[CalculatedValue]
),
0
)
I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!