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 All,
I need to calculate the difference between consecutive values between the "Budget" parameter and the "B" column.
It should look like that each time we subtract the value from the "B" column from the budget, which has been reduced by the value of all its predecessors.
A, B - available in the form of a column and a metric
Budget - parameter (separate table created by Power BI)
Example (period 1):
Budget = 6 230 000
B = 1 617 432
Result = 6 230 000 - 1 617 432 = 4 612 568
Example (period 2):
Budget = 6 230 000 - 1 617 432 = 4 612 568
B = 702 897
Result = 4 612 568 - 702 897 = 3 909 671
Current result: I managed to achieve this effect by using single metrics and overlapping 12 individual cards (which is not professional and does not allow exporting the entire table to Excel).
Expected result: each time the budget should be reduced by the value from column "B".
Does anyone have an idea how to implement this? Perhaps using variables that would store such information.
Thank you!
Solved! Go to Solution.
Hi, @Anonymous
According to your description, you want to "Parameter and measure that will subtract values from the previous one".
Here are the steps you can refer to :
(1)This is my test data:
(2)I create a [B] measure as your B column in the visual :
B = SUM('Table'[Value])
(3)Then we can create a measre like this :
Measure = var _slicer = [Parameter Value]
var _cur_date = MAX('Table'[Date])
var _t= FILTER( ALLSELECTED('Table') , 'Table'[Date] <= _cur_date)
return
_slicer - SUMX(_t, [B])
(4)Then we can put the measure on the visual and we can meet your need :
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi, @Anonymous
According to your description, you want to "Parameter and measure that will subtract values from the previous one".
Here are the steps you can refer to :
(1)This is my test data:
(2)I create a [B] measure as your B column in the visual :
B = SUM('Table'[Value])
(3)Then we can create a measre like this :
Measure = var _slicer = [Parameter Value]
var _cur_date = MAX('Table'[Date])
var _t= FILTER( ALLSELECTED('Table') , 'Table'[Date] <= _cur_date)
return
_slicer - SUMX(_t, [B])
(4)Then we can put the measure on the visual and we can meet your need :
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi v-yueyunzh-msft!
It works! Thank you very much for help.
I really appreciate it!
All the best to you!
Share sample pbix file to help you
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |