Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello everyone
I'm trying to calculate the DQ% for my company and that requires me to divide the total DQ (measure) running by just the first day of the month (not the whole month) for some reson no matter what I do is do all month. What am I doing wrong here? I also provided the DAX code for all fields.
Solved! Go to Solution.
@Anonymous
Overall DQ $ StartOfMonth =
CALCULATE (
[Overall DQ $],
'Total Collected'[date] = DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
@Anonymous
It'd be better to operate with a date table. The previous version was too limited in that it operated on the current month only. Let's make a more general version:
Overall DQ $ StartOfMonth =
CALCULATE (
[Overall DQ $],
FILTER (
ALL ( 'Total Collected'[date] ),
'Total Collected'[date]
= EOMONTH ( MAX ( 'Total Collected'[date] ), -1 ) + 1
)
)
and then for the previous month, using the measure above:
Overall DQ $ StartOfMonth Previous =
CALCULATE (
[Overall DQ $ StartOfMonth],
FILTER (
ALL ( 'Total Collected'[date] ),
'Total Collected'[date] = EDATE ( MAX ( 'Total Collected'[date] ), -1 )
)
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
@Anonymous
Overall DQ $ StartOfMonth =
CALCULATE (
[Overall DQ $],
'Total Collected'[date] = DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
That worked!!!!! Thank you so much for your help!!
Any idea how I can compare to last month on the line chart?
Hi @Anonymous
Overall DQ $ StartOfMonth =
IF (
MAX ( 'Total Collected'[date] )
= DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ),
[Overall DQ $],
0
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Thank you!! That worked slightly. But the percent is not going down for all of the days?
I need it to divide by the first of the month for each day! I am so close!!
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
122 | |
101 | |
71 | |
61 |