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.
Good Day,
I have a very simple problem that I can not solve. I simply want to get the difference between the most recent and the oldest value in a table (as Delta). I want to use the most recent (as Today) and the oldest (as Oldest) and determine the % change: (Oldest - Today)/(Oldest).
Returning values as a scalar turns out to be a nightmare in PBI. Thus I created a workaround to use measures to flag the Lastest and Oldest values in my table. Use a measure to only sum the values that are flagged. Now I get a different problem. I can see the values in my table, but they don't show in my cards (Sum total shows).
Below is a screenshot. I also have a link to the PBIX file below. Any help would be much appreciated!
Solved! Go to Solution.
You should be able to calculate it with something along the lines of:
min PLS = VAR minDate = Calculate(MIN(claendar[{date]) , allselected(calendar)) return Calculate( sum([amount]) , calendar[date] = minDate )
Hi @JBI
Sorry can not see the link, but try the below if it works for you as measures.
first value = CALCULATE( SELECTEDVALUE( YourTable[Value] ), FIRSTDATE( YourTable[Date] ) )
last value = CALCULATE( SELECTEDVALUE( YourTable[Value] ), LASTDATE( YourTable[Date] ) )
This also works. Thanks man I appreciate
The issue is with the PLS formulas. The only produce a value if the date calendar is filtered to the flagged date. Which it will never be in a card or in a total.
Add another option in your if statement that checks if
SELECTEDVALUE('Calendar'[Date]) = BLANK()
This should return true if calculated where there is no date dimension filtering.
Hi @tex628,
SELECTEDVALUE doesn't work since it requires a column as a parameter and in my example the flag is created by a measure.
Do you know how to solve this problem without using measures to flag which two columns to use?
Thanks!
You should be able to calculate it with something along the lines of:
min PLS = VAR minDate = Calculate(MIN(claendar[{date]) , allselected(calendar)) return Calculate( sum([amount]) , calendar[date] = minDate )
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |