Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a table that looks like this:
what i need to do to add a column that subtract a certain amount (this certain amount will be a measure) considering the date ?
So i have something like this:
Solved! Go to Solution.
Hi @cccarv82
Here is the sample file with the solution https://we.tl/t-eHYz5Ypz3F
I hope this is what you're looking for
Actual Value =
VAR Current_Value = Table_1[value]
VAR Current_Date = Table_1[date_day_by_day]
VAR CurrentItem_Table = CALCULATETABLE ( Table_1, ALLEXCEPT ( Table_1, Table_1[Name] ) )
VAR First_Date = MINX ( CurrentItem_Table, Table_1[date_day_by_day] )
VAR Last_Date = MAXX ( CurrentItem_Table, Table_1[date_day_by_day] )
VAR NumberOfDays = DATEDIFF ( First_Date, Current_Date, DAY )
VAR TotalNumberOfDays = DATEDIFF ( First_Date, Last_Date, DAY )
VAR DailyValue = DIVIDE ( Current_Value, TotalNumberOfDays )
RETURN
Current_Value - DailyValue * NumberOfDays
Hi @cccarv82
Here is the sample file with the solution https://we.tl/t-eHYz5Ypz3F
I hope this is what you're looking for
Actual Value =
VAR Current_Value = Table_1[value]
VAR Current_Date = Table_1[date_day_by_day]
VAR CurrentItem_Table = CALCULATETABLE ( Table_1, ALLEXCEPT ( Table_1, Table_1[Name] ) )
VAR First_Date = MINX ( CurrentItem_Table, Table_1[date_day_by_day] )
VAR Last_Date = MAXX ( CurrentItem_Table, Table_1[date_day_by_day] )
VAR NumberOfDays = DATEDIFF ( First_Date, Current_Date, DAY )
VAR TotalNumberOfDays = DATEDIFF ( First_Date, Last_Date, DAY )
VAR DailyValue = DIVIDE ( Current_Value, TotalNumberOfDays )
RETURN
Current_Value - DailyValue * NumberOfDays
Hi @cccarv82
please provide more details. How does your report look like? Can share sample file?
Hi @tamerj1 !!
First i have this column:
For each item i have a value, ok... then i expanded my table to be daily detailed and reach this:
Now i have the same value for each row but i want to add a column to show the new value where each day i subtract a measured value for each item so i can have Item 1 from 10 to 0 from 01/04/2022 to 14/04/2022 (in this example) and for Item 2 i will have from 10 to 0 from 15/04/2022 to 26/04/2022.
Here is the file:
I'll work on it and get back to you by tomorrow morning. Thank you
hi @amitchandak !
This way i will subtract the date. I need something like
[Number] - [Measure]
But this doesnt work aswell because i will have the same result for all rows. I need to have a new result per row, like this:
the [number_by_date] is my new column where i have the result of the subtract but i i just use [number] - [measure] i will have the wrong result.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
13 | |
11 | |
8 |