Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Everyone,
I created a measure using below query. Logic wise it is correct but the only thing I am facing right now is that It is returning all the rows from the table. What I observe is I am getting this output because in Var R1 and R2 I am doing some calculation. As you can see below i am adding 1 and also multiplying it with 10. This is applying to each row in the table. Can someone please let me know how should I write R1 and R2.
I also have a date slicer in the report page. where I am selecting only 1 date.
IndexBaseValue =
Var Mindate = CALCULATE(MIN(IndexFundNAV[Date]),ALL(IndexFundNAV[Date]))
Var Maxdate = CALCULATE(MAX(IndexFundNAV[Date]))
Var Currentdate = IF(Maxdate<Mindate,Mindate,Maxdate)
Var Diffdays = DATEDIFF(Mindate,Currentdate,DAY)
Var R1 = CALCULATE(10*(1+[RITD%]))
Var R2 = CALCULATE((10*(1+[RITD%]))^(Diffdays/365))
Var Result = if (Diffdays<365,R1,R2)
Return
Result
Example for desired output:
Date IndexName IndexBaseValue
28-Sep-19 ABC 8.9
Currently getting:
Date IndexName IndexBaseValue
28-Sep-19 ABC 10
28-Sep-19 ABC 10
28-Sep-19 ABC 10
28-Sep-19 ABC 8.9
@Anonymous - A little difficult to tell what is going on, sample source data might help.
Check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
Thanks @Greg_Deckler for your reply. I will check the links which you have shared. However my issue got resolved. There was some table relatioship issue was there because of that the measure not returing the correct answer.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
20 | |
3 | |
2 | |
2 | |
2 |