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 created the following code
FTE_Prev_Mnth =
CALCULATE(
[FTE_Demand],
PREVIOUSMONTH(Date_Dim[Date]) , Date_Dim[Date] <= MAX(Date_Dim[Date]) )
Which then goes into
FTE_Mnth_Var = CALCULATE([FTE_Demand] - [FTE_Prev_Mnth] )
The output is:
Year | Month | FTE_Demand | FTE_Mnth_Var |
2024 | May | 626.5572 | 1.773035 |
2024 | June | 625.0259 | -1.53131 |
2024 | July | 648.6083 | 23.58244 |
2024 | August | 655.1697 | 6.561367 |
2024 | September | 655.0414 | -0.12826 |
2024 | October | 676.5294 | 21.48798 |
2024 | November | 684.7248 | 8.195445 |
2024 | December | 689.8698 | 5.145005 |
2025 | January | 668.7971 | -21.0728 |
2025 | February | 675.9296 | 7.132578 |
2025 | March | 685.1627 | 9.233071 |
2025 | April | 691.6453 | 6.482635 |
2025 | May | 629.0432 | -62.6022 |
2025 | June | 631.6405 | 2.597319 |
2025 | July | 613.5211 | -18.1194 |
2025 | August | 616.9264 | 3.405306 |
How can i add the different months of FTE_Mnth_Var together bearing in mind they are a measure and not calculated column - i want to see the difference between for example june 2024 & March 2025 using my Date_Dim Table. Also the 1.77 showing in May 2024 shouldnt be showing amonth variance if that month isnt visible?
Thank you
Jack
Solved! Go to Solution.
Hi,@pbijack93
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2. First of all, about your line value does not exist will not be counted, I recommend that you use the ISBLANK () function, his role is to first determine whether the value is empty, it is recommended that you can modify your measure to the following code:
TE_Mnth_Var=
IF(
ISBLANK([FTE_Prev_Mnth]),
BLANK(),
[FTE_Demand] - [FTE_Prev_Mnth]
)
Here is the relevant documentation:
ISBLANK function (DAX) - DAX | Microsoft Learn
3.Secondly, if you want to count the values in the date interval you set (the values come from a measure), you can also use the Sumx() function, here is the measure I created to meet your needs:
Measure = SUMX('Date_Dim',CALCULATE([FTE_Mnth_Var],FILTER('Date_Dim','Date_Dim'[Date]>DATE(2024,6,1)&&'Date_Dim'[Date]<DATE(2025,3,1))))
Here is the documentation for it:
SUMX function (DAX) - DAX | Microsoft Learn
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,@pbijack93
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2. First of all, about your line value does not exist will not be counted, I recommend that you use the ISBLANK () function, his role is to first determine whether the value is empty, it is recommended that you can modify your measure to the following code:
TE_Mnth_Var=
IF(
ISBLANK([FTE_Prev_Mnth]),
BLANK(),
[FTE_Demand] - [FTE_Prev_Mnth]
)
Here is the relevant documentation:
ISBLANK function (DAX) - DAX | Microsoft Learn
3.Secondly, if you want to count the values in the date interval you set (the values come from a measure), you can also use the Sumx() function, here is the measure I created to meet your needs:
Measure = SUMX('Date_Dim',CALCULATE([FTE_Mnth_Var],FILTER('Date_Dim','Date_Dim'[Date]>DATE(2024,6,1)&&'Date_Dim'[Date]<DATE(2025,3,1))))
Here is the documentation for it:
SUMX function (DAX) - DAX | Microsoft Learn
Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |