Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi all
I am trying to create a dax formula which lets me create the below table in power bi but have come across issues.
This is the measure I've tried to use but it does not work:
PreviousDayToStartOfMonthErrors = VAR CurrentDate = TODAY() VAR StartOfMonth = DATE(YEAR(CurrentDate), MONTH(CurrentDate), 1) VAR PreviousDay = CurrentDate - 1 //
RETURN CALCULATE( SUMX( DISTINCT(DataQualityDashboard[RuleImplementationID]),
CALCULATE( SUM(DataQualityDashboard[ErrorCount]), DataQualityDashboard[DateStamp] >= DATE(YEAR(StartOfMonth), MONTH(StartOfMonth), DAY(StartOfMonth) - 1) && DataQualityDashboard[DateStamp] <= PreviousDay ) ) )
Date | Errors Month To Date | Previous Day |
01-Jan-24 | 505278 | |
02-Jan-24 | 505678 | 505278 |
03-Jan-24 | 505245 | 505678 |
04-Jan-24 | 503607 | 505245 |
Is anyone able to help please?
Solved! Go to Solution.
This seems to be missing some important details. Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
Consider using OFFSET -1
Hi @BOti62 ,
Not being able to fully understand your needs based only on the information you provided, I tried to modify the DAX a bit:
PreviousDayToStartOfMonthErrors =
VAR CurrentDate = TODAY()
VAR StartOfMonth = DATE(YEAR(CurrentDate), MONTH(CurrentDate), 1)
VAR PreviousDay = CurrentDate - 1
RETURN
CALCULATE(
SUM(DataQualityDashboard[ErrorCount]),
FILTER(
DataQualityDashboard,
DataQualityDashboard[DateStamp] >= StartOfMonth &&
DataQualityDashboard[DateStamp] <= PreviousDay
)
)
If this is still not possible, please provide the full sample data and data model, as well as example screenshots of the results you would like to get, thank you!
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Create a Calendar Table. Create a relationship (Many to One and Single) from the Date column of your Data Table to the Date column of the Calendar Table. To your visual/filter/slicer, drag Date from the Calendar Table. Write these measures:
Errors = counta(Data[Error])
Errors on previous day = calculate([errors],previousday(calendar[date]))
Hope this helps.
Hi,
Create a Calendar Table. Create a relationship (Many to One and Single) from the Date column of your Data Table to the Date column of the Calendar Table. To your visual/filter/slicer, drag Date from the Calendar Table. Write these measures:
Errors = counta(Data[Error])
Errors on previous day = calculate([errors],previousday(calendar[date]))
Hope this helps.
Hi @BOti62 ,
Not being able to fully understand your needs based only on the information you provided, I tried to modify the DAX a bit:
PreviousDayToStartOfMonthErrors =
VAR CurrentDate = TODAY()
VAR StartOfMonth = DATE(YEAR(CurrentDate), MONTH(CurrentDate), 1)
VAR PreviousDay = CurrentDate - 1
RETURN
CALCULATE(
SUM(DataQualityDashboard[ErrorCount]),
FILTER(
DataQualityDashboard,
DataQualityDashboard[DateStamp] >= StartOfMonth &&
DataQualityDashboard[DateStamp] <= PreviousDay
)
)
If this is still not possible, please provide the full sample data and data model, as well as example screenshots of the results you would like to get, thank you!
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This seems to be missing some important details. Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
Consider using OFFSET -1
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.