Forum Discussion
Have calculated IF statement based on date slicer
- Anonymous6 years ago
Hi Anonymous
Try this measure
Measure 2 =var currencyVALUE=MAX(Sales[Currency])returnIF(MIN(Sales[Date])=MIN('Date'[Date]),SELECTEDVALUE(Sales[Value 1])*CALCULATE(MAX('Currency'[FX Rate]),FILTER('Currency','Currency'[Date]=MAX('Date'[Date]) && 'Currency'[Currency]=currencyVALUE)),IF(MIN(Sales[Date])=MAX('Date'[Date]),(SELECTEDVALUE(Sales[Value 1])+SELECTEDVALUE(Sales[Value 2]))*CALCULATE(MAX('Currency'[FX Rate]),FILTER('Currency','Currency'[Date]=MAX('Date'[Date]) && 'Currency'[Currency]=currencyVALUE)),IF(MIN('Date'[Date])>MIN(Sales[Date]) &&MIN(Sales[Date]) <MAX('Date'[Date]),SELECTEDVALUE(Sales[Value 2])*CALCULATE(MAX('Currency'[FX Rate]),FILTER('Currency','Currency'[Date]=MAX('Date'[Date]) && 'Currency'[Currency]=currencyVALUE)))))Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.
Hi Anonymous
Your actual requirement was calculation to be dynamic.
For dynamic calculations we need to use measure as calculated columns are loaded at first load only.
so coming to your next requirement, could you please share some sample data and expected output?
Thanks,
Pravin
Hi Anonymous
Thank you for your reply.
I'm looking to use the XIRR function based on the measure we have created. Please find this table with measure below:
| Name | Currency | Date | Value 1 | Value 2 | Measure |
| A | I | 31/03/2010 | 200 | 20 | -160 |
| A | I | 30/06/2010 | 200 | 100 | 80 |
| A | P | 30/09/2010 | 150 | 0 | 0 |
| A | O | 31/12/2010 | 150 | 20 | 20 |
| A | I | 31/03/2011 | 100 | 10 | 8 |
| A | O | 30/06/2011 | 150 | 50 | 50 |
| A | P | 30/09/2011 | 110 | 20 | 12 |
| A | I | 31/12/2011 | 120 | 20 | 16 |
| A | I | 31/03/2012 | 110 | 60 | 136 |
When entering the XIRR function in Excel and by using the same table, my output is: 0.833474
I'm looking to get the exact same number in Power BI by using the XIRR function in here using the measure. This means the XIRR needs to be incorporated into a measure which will output this single value.
The issue is, that the XIRR function expects a column instead of a measure as input for the values.
Please let me know if you need anything else.
All help would be much appreciated!
Stan
- Anonymous6 years agoNot applicable
Hi Anonymous Pravin,
It would be greatly appreciated if you could help me with the above! Please let me know if you need anything else.
Kind regards
Stan