Forum Discussion
Peppearson
3 years agoHelper I
Combining Two Measures
Hi All, I'm trying to create a measure which is a combination of two different measures and which changes in line with a date slicer. Example There are two data tables with actual sales a...
- 3 years ago
Hi Peppearson,
You can try using:
Combined = CALCULATE(SUM('Table1'[Actual Sales]), FILTER('Table1', MONTH('Table1'[Date])<=MONTH(SELECTEDVALUE('Filter'[Date])))) + CALCULATE(SUM('Table2'[Projected Sales]), FILTER('Table2', MONTH('Table2'[Date])>MONTH(SELECTEDVALUE('Filter'[Date]))))Works for you? Mark this post as a solution if it does!
Check out this blog of mine: How to Export Telemetry Data from Azure IoT Central into Power BI
Anonymous
3 years agoNot applicable
Hi Peppearson ,
Please refer to my pbix file to see if it helps you.
Create a measure.
Measure =
VAR _selecteddate =
SELECTEDVALUE ( 'Table'[Date] )
VAR _1jie =
CALCULATE (
MAX ( Actual[Actual Sales] ),
FILTER (
ALL ( Actual ),
Actual[Date] = SELECTEDVALUE ( Actual[Date] )
&& Actual[Food Type] = SELECTEDVALUE ( Actual[Food Type] )
)
)
VAR _2jie =
CALCULATE (
MAX ( Projected[Projected Sales] ),
FILTER (
ALL ( Projected ),
Projected[Date] = SELECTEDVALUE ( Actual[Date] )
&& Projected[Food Type] = SELECTEDVALUE ( Actual[Food Type] )
)
)
VAR _selectedfood =
SELECTEDVALUE ( food[Food Type] )
RETURN
IF (
_selecteddate >= SELECTEDVALUE ( Actual[Date] )
&& _selectedfood = SELECTEDVALUE ( Actual[Food Type] ),
_1jie,
_2jie
)
If I hvae misunderstood your meaning, please provide desired output with more details.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.