Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi! I did quite a bit of research but can't find a solution. I need to have a daily percentage change for each of the kpi value for each of the company for ech of the projection year. I tried the below approach but second DAX returned empty values.
https://community.powerbi.com/t5/Desktop/Previous-date-values/m-p/136270#M58429
Updated Date | Company Name | Projection Year | KPI | Value |
3/25/2021 | Company A | 12/31/2022 | AA | $ 1,050 |
3/25/2021 | Company A | 12/31/2022 | BB | $ 800 |
3/25/2021 | Company A | 12/31/2022 | CC | $ 900 |
3/25/2021 | Company A | 12/31/2023 | AA | $ 1,550 |
3/25/2021 | Company A | 12/31/2023 | BB | $ 1,200 |
3/25/2021 | Company A | 12/31/2023 | CC | $ 1,300 |
3/25/2021 | Company B | 12/31/2022 | AA | $ 1,890 |
3/25/2021 | Company B | 12/31/2022 | BB | $ 1,440 |
3/25/2021 | Company B | 12/31/2022 | CC | $ 1,620 |
3/25/2021 | Company B | 12/31/2023 | AA | $ 2,790 |
3/25/2021 | Company B | 12/31/2023 | BB | $ 2,160 |
3/25/2021 | Company B | 12/31/2023 | CC | $ 2,340 |
3/26/2021 | Company A | 12/31/2022 | AA | $ 1,103 |
3/26/2021 | Company A | 12/31/2022 | BB | $ 840 |
3/26/2021 | Company A | 12/31/2022 | CC | $ 945 |
3/26/2021 | Company A | 12/31/2023 | AA | $ 1,628 |
3/26/2021 | Company A | 12/31/2023 | BB | $ 1,260 |
3/26/2021 | Company A | 12/31/2023 | CC | $ 1,365 |
3/26/2021 | Company B | 12/31/2022 | AA | $ 1,985 |
3/26/2021 | Company B | 12/31/2022 | BB | $ 1,512 |
3/26/2021 | Company B | 12/31/2022 | CC | $ 1,701 |
3/26/2021 | Company B | 12/31/2023 | AA | $ 2,930 |
3/26/2021 | Company B | 12/31/2023 | BB | $ 2,268 |
3/26/2021 | Company B | 12/31/2023 | CC | $ 2,457 |
Solved! Go to Solution.
@muhitdinfa1 , Try a new column.
new column =
maxx(filter( 'Table', 'Table'[Company Name] = earlier('Table'[Company Name] ) && 'Table'[Projection Year] = earlier('Table'[Projection Year] )
&& 'Table'[Updated Date ] = earlier('Table'[Updated Date] ) -1
&& 'Table'[KPI = earlier('Table'[KPI] )), 'Table'[Value] )
Or new measure with date table
This Day = CALCULATE(sum('Table'[Value ]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('Table'[Value ]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
@muhitdinfa1 , Try a new column.
new column =
maxx(filter( 'Table', 'Table'[Company Name] = earlier('Table'[Company Name] ) && 'Table'[Projection Year] = earlier('Table'[Projection Year] )
&& 'Table'[Updated Date ] = earlier('Table'[Updated Date] ) -1
&& 'Table'[KPI = earlier('Table'[KPI] )), 'Table'[Value] )
Or new measure with date table
This Day = CALCULATE(sum('Table'[Value ]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
Last Day = CALCULATE(sum('Table'[Value ]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))
@amitchandak Thank you very much! Unfortunately, it didn't work with my data table. It is returing empty values for 98% of the rows whereas for the rest of the 2%, I am seeing the same values as last date.
However, when I tried it with the same exact data table per my example above, it worked. What do you think is different? Although it should be the same output because we're using the same logic.
I actually had to convert my timestamp field into "short date" column and it worked. I think when we subtructed 1 from the date field, it was initally taking away just one second instead of 1 day.
User | Count |
---|---|
124 | |
108 | |
99 | |
62 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |