Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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 | |
11 | |
10 | |
10 | |
10 |
User | Count |
---|---|
18 | |
13 | |
12 | |
11 | |
8 |