Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
ISSUE:
The following code:
CALCULATE(
DIVIDE(
CALCULATE(
SUMX('IVDS Summary', [Count]),
ALLSELECTED('DimDate'[Date]),
ALL(DimDate[Year]),
ALL(DimDate[MonthNameShort]),
ALL(DimDate[Day]),
ALL(DimDate[DayOfWeekShort])
),
COUNT('DimDate'[Date]),
0
),
ALLSELECTED('DimDate'[Date]),
ALL(DimDate[Year]),
ALL(DimDate[MonthNameShort]),
ALL(DimDate[Day]),
ALL(DimDate[DayOfWeekShort])
)
with a DimDate[Date] slicer filtering the 'IVDS Summary' table on its [Date] column, plus DimDate[Year], DimDate[MonthNameShort], DimDate[Day], DimDate[DayOfWeekShort] in the X-axis data wells of the Line and Clustered Column visual produces this erroneous reset in the calculation every single time a new month starts. It's as if the CALCULATE is computed only on 30 or 31 days (depending on the month) even though the date slicers are set to 12 months:
In other words, the code above is supposed to produce a horizontal line for the whole selected period regardless of the dates on the x-axis. In this particular instance, an average over the whole period (or n days), while the columns represent the different sums for each day. So no rocket science here. 😋
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Element115 ,
Thank you very much for the question! But this this seems reasonable. Since there are only twelve months in a year, when traversing the data, it is calculated as a set of 12 data points. Also there may be a possibility of misuse of ALL(), for example if you want a month's worth of data and you traverse the weekly ordinal numbers, there may be a case of spanning the same week, in which case I think traversing the year and the month is sufficient.
Best regards,
Community Support Team_ Scott Chang