Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Nishanthi
Contributor II
Contributor II

How to sum up values using If when the value is splitted into two rows

In the below scenario, if Jan month has fcst and actual , then only "Actual" has to be considered. If there's no entry for actual then "Fcst" has to be considered.

Sample data:

Project idMonthBudget TypeAmount
123JanFcst10,000
123JanActual5,000
999JanFcst12,000
658JanFcst30,000
658JanActual30,000
Labels (1)
2 Replies
edwin
Master II
Master II

a simple expression would be:
if(count({<[Budget Type]={'Actual'}>}[Budget Type])>0, sum({<[Budget Type]={'Actual'}>}Amount), sum({<[Budget Type]={'Fcst'}>}Amount))

which translates to if there is at least 1 count of Budget type=actual for the product, use actual else use forecast
this assumes that you will use Product at least as dimension

Nishanthi
Contributor II
Contributor II
Author

Thanks Edwin. But any chance to pull in the backend ?