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.
Dear PBI Community, thank you in advance for the help
I am new to Power BI & DAX
I have tow tables
1) flock table with an initial number of birds.
2) Birds mortality logs
I want to add new colum in mortality log table wich gives the current birds count by subtracting previous mortality
Solved! Go to Solution.
If you want to do it using DAX, you can first create a one to many relationship between the two tables based on flock id in both tables (that will make it much faster and easier)
the create New Column >
Balance No. of Birds =
VAR CurrentID = Mortality[id]
VAR FlockTable =
CALCULATETABLE ( Motality, ALLEXCEPT ( Mortalit, Mortalit[flock_id] ) )
VAR PreviousIDsTable =
FILTER ( FlockTable, Mortality[id] <= CurrentID )
VAR TotalMortality =
SUMX ( PreviousIDsTable, Mortality[mortality] )
VAR FlockPopulation =
RELATED ( Flocks[no_of_birds] )
RETURN
FlockPopulation - TotalMortality
If you want to do it using DAX, you can first create a one to many relationship between the two tables based on flock id in both tables (that will make it much faster and easier)
the create New Column >
Balance No. of Birds =
VAR CurrentID = Mortality[id]
VAR FlockTable =
CALCULATETABLE ( Motality, ALLEXCEPT ( Mortalit, Mortalit[flock_id] ) )
VAR PreviousIDsTable =
FILTER ( FlockTable, Mortality[id] <= CurrentID )
VAR TotalMortality =
SUMX ( PreviousIDsTable, Mortality[mortality] )
VAR FlockPopulation =
RELATED ( Flocks[no_of_birds] )
RETURN
FlockPopulation - TotalMortality
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 |