Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.