Forum Discussion
Formula de excel a Power BI
Best regards!
I hope you can help me.
I have the following information:
| Date | Accumulated Revenue | Revenue projection t+1 |
| one-19 | $ 118.325.626.888,57 | $ 114.731.021.865,40 |
| feb-19 | $ 242.114.159.245,70 | $ 119.465.068.991,54 |
| mar-19 | $ 366.677.886.888,76 | $ 132.620.516.974,27 |
| Apr-19 | $ 503.161.709.920,51 | $ 131.008.119.879,19 |
| may-19 | $ 648.250.033.859,78 | $ 130.529.858.630,79 |
| Jun-19 | $ 791.795.000.803,46 | $ 130.641.679.368,39 |
| jul-19 | $ 935.485.119.962,16 | $ 133.541.603.731,00 |
| ago-19 | $ 1.088.452.186.875,16 | $ 141.016.852.091,76 |
| sep-19 | $ 1.236.647.726.814,08 | $ 141.130.823.228,16 |
| oct-19 | $ 1.382.518.537.906,08 | $ 148.986.636.006,17 |
| nov-19 | $ 1.531.111.853.469,08 | $ 149.123.894.461,00 |
| dic-19 | $ 1.686.234.563.500,03 | $ 151.025.590.441,80 |
| one-20 | $ 150.469.999.295,95 | $ 153.119.857.389,81 |
| feb-20 | $ 315.349.160.179,12 | $ 165.074.258.734,52 |
| mar-20 | $ 491.450.969.659,68 | $ 172.088.543.017,20 |
| Apr-20 | $ 675.930.702.288,32 | $ 170.951.207.433,98 |
| may-20 | $ 862.716.526.862,75 | $ 173.349.605.293,28 |
| Jun-20 | $ 1.043.420.935.089,42 | $ 173.299.716.981,05 |
| jul-20 | $ 1.221.212.172.146,13 | $ 171.499.871.814,00 |
| ago-20 | $ 1.396.300.415.442,84 | $ 169.341.044.227,01 |
| sep-20 | $ 1.572.011.000.432,55 | $ 169.708.397.776,76 |
I proceed to explain each variable:
- Accumulated Revenue: As the name implies, it corresponds to the cumulative value of monthly cut income and is reset in January of each year, i.e. once January arrives, the revenue corresponds to the monthly net without taking values from the previous month (December).
- Revenue projection t+1: Corresponds to the estimated amount of money to be received within the following month, i.e. the value in this column during the month of January, corresponds to the monthly net income that is planned to be received in February.
The intention is to calculate a new variable called "Projected Accumulated Income" in order to generate a line chart and buy the accumulated revenue vs the projected accumulated income. excel would look like this:
- For the "January" months it would be this way.
- For the other months it would be like this:
Any idea how I can do this in power BI ?
Thank you very much in advance.
Hi JuanDtM23 ,
First, you need to split year and month in number format in the query editor.
Then create measure like this:
Measure = var current_month = MAX('Table'[Month]) var current_year = MAX('Table'[Year]) var no_month_1 = CALCULATE(SUM('Table'[Accumulated Revenue])+SUM('Table'[Revenue projection t+1]),FILTER(ALL('Table'),'Table'[Year]=current_year&&'Table'[Month]=current_month-1)) return IF(current_month=1,SUM('Table'[Revenue projection t+1]),no_month_1)Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- V-lianl-msftCommunity Support
Hi JuanDtM23 ,
First, you need to split year and month in number format in the query editor.
Then create measure like this:
Measure = var current_month = MAX('Table'[Month]) var current_year = MAX('Table'[Year]) var no_month_1 = CALCULATE(SUM('Table'[Accumulated Revenue])+SUM('Table'[Revenue projection t+1]),FILTER(ALL('Table'),'Table'[Year]=current_year&&'Table'[Month]=current_month-1)) return IF(current_month=1,SUM('Table'[Revenue projection t+1]),no_month_1)Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- JuanDtM23Helper II