Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I have a measure that pwerform sum up as shown.
.
I would like to have additional 2 measures:-
1) to calculate the difference between the values of these two dates before summing them up. i.e. this month values - last month values then perform the sum up.
2) to calculate how many values that was <>0 (<0 or >0) after finding the dfferent.
How can I achieve this? Thanks.
Sum QR-A =
VAR Selected_Date = MAX(CalendarDate[Date])
VAR Previous_Date = CALCULATE(MAX(CalendarDate[Date]), PREVIOUSMONTH(CalendarDate[Date]))
VAR Sum_A = CALCULATE(
SUM('Raw Data'[Gradient-A]),
FILTER(
'Raw Data',
NOT(
(
YEAR('Raw Data'[P-Date]) = YEAR(Selected_Date) &&
MONTH('Raw Data'[P-Date]) = MONTH(Selected_Date)
) ||
(
YEAR('Raw Data'[R-Date]) = YEAR(Selected_Date) &&
MONTH('Raw Data'[R-Date]) = MONTH(Selected_Date)
) ||
(
YEAR('Raw Data'[P-Date]) = YEAR(Previous_Date) &&
MONTH('Raw Data'[P-Date]) = MONTH(Previous_Date)
) ||
(
YEAR('Raw Data'[R-Date]) = YEAR(Previous_Date) &&
MONTH('Raw Data'[R-Date]) = MONTH(Previous_Date)
)
)
)
)
RETURN Sum_A + 0
Hi @Amos_Lim
To help you better, please provide some dummy data as well as the expected results. Preferably in tabular form.
Regards,
Nono Chen
Please find the attached sample file.
The raw data sheet was imported into Power BI, and the expected result sheet contains my manual calculations.
The latest data within the same month was not included. For example, if a same A-set and C-No occur one or more times within the same month, only the data from the last date is used. Additionally, P-Date and R-Date data were excluded.
Not sure if this is achievable in PBI or power query?