Forum Discussion
Combining Two Measures
- 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
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
- Peppearson3 years agoHelper I
Hi Shaurya
Thank you for your help.
I used a variation on your dax code but turned both calculate formulas into variables.
I also replaced the below in both formulas with the parameter value that I'm using.MONTH(SELECTEDVALUE('Filter'[Date])See below what the code ended up like.
Combined =
Var Actual Sales
CALCULATE(SUM('Table1'[Actual Sales]), FILTER('Table1', MONTH('Table1'[Date])<=Parameter[Parameter Value]))
VAR ProjectedSales
CALCULATE(SUM('Table2'[Projected Sales]), FILTER('Table2', MONTH('Table2'[Date])>Parameter[Parameter Value]))
Return
If(ActualSales=0,
ProjectedSales(measure),
ActualSales+ProjectedSales