Forum Discussion
Dynamic Measure as per selection (In my case Date selection)
- 2 years ago
This is what i have been able to come up with. PBi file attached.
Hi Ashish_Mathur , Anonymous
Thanks for your response.
I will try to provide data clearly if you coudn't able to access the file.
Raw Data:
| Material | Date | Quantity | Price |
| X1 | 01.01.2023 | 88000 | 130262 |
| X2 | 01.01.2023 | 66000 | 133643,4 |
| X3 | 01.01.2023 | 84000 | 283080 |
| X1 | 01.01.2024 | 66000 | 99220 |
| X2 | 01.01.2024 | 36000 | 73198,8 |
| X3 | 01.01.2024 | 0 | 0 |
| X1 | 01.02.2023 | 110000 | 154022 |
| X2 | 01.02.2023 | 66000 | 125947,8 |
| X3 | 01.02.2023 | 0 | 0 |
| X1 | 01.02.2024 | 88000 | 127028 |
| X2 | 01.02.2024 | 56660 | 111166,9 |
| X3 | 01.02.2024 | 42000 | 128520 |
Net Price:
Cell D7=IFERROR(H7/L7;C7)
Cost Saving Cell:
Cell B5 ==INDEX($C5:$F5;1;MATCH($B$1;$C$4:$F$4;0))
Savings:
Cell O5 = =IFERROR(M5*(E5-$B5);"")
To be more clear,
As I change date in cell B1, values in column B (Cost saving ) will change, accordingly values in "saving" column will change.
For example:
Selected Date : 01.01.2023
Selected Date 01.02.2023
Now in excel we see values of column O depends on Column B and this column B values are changing according to date selection in cell "B1". In Power BI I am trying to have a measure for Saving column.
Hi Ashish_Mathur
Is that possible to achieve above in power BI?
Thanks !
- Ashish_Mathur2 years agoSuper User
This is what i have been able to come up with. PBi file attached.
- The82 years agoHelper II
Hi Ashish_Mathur
I tried you solution with relal time data, your logic and measures fits very well.
Thanks for your time and response.- Ashish_Mathur2 years agoSuper User
You are welcome. This was a tough one to solve.
- The82 years agoHelper II
Hi Ashish_Mathur ,
The reason for asking below question is Dulpicate date rows between Earliest and Latest date in a table because when I change remove rows where Quantity and Price columns are Zero then I coudn't able to get the expected result as below
Before changing data 👇 :After removing rows (6 & 9) when Quantity equals to Zero. I am missing value for Material X3 for the month of February 2024 as in excel screen shot below
After removing rows 6 & 9, I am missing Material X3 for the month of February 2024 as belowIn my actual data I don't have data when quantity is Zero, so I just wanted to duplicate the values with Zero between earliest and Latest available dates.
By the way, thanks for your response.