This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! 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.