Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hweaves12
Frequent Visitor

Data Refresh

I'm using the DimDate calendar from Ruth at Curbal which generates my calendar for me and I've added a column to that table IsWorkingDay which says if its a Saturday or a Sunday then 0 else its a 1.

The DimDate calendar generates all dates from a given start date up to today's date.

So I can calculate the number of working days so far this month with the following

Working Days So Far This Month = TOTALMTD(SUM(DimDate[IsWorkingDay]),DATESMTD(DimDate[Date]))

 

However I needed to work out the total number of working days for the whole month  so I created a table (Working Days).

Three columns StartOfMonth, NumberofDays and MonthName.

So something like 01/01/2017,20,Jan then 01/02/2017,20,Feb then 01/03/2017,23,Mar and so on for the rest of the year.

 

I've created the relationship linking the StartOfMonth date in the Working Days table to the Date field in the DimDate table.

 

One of the measures I created on the WorkingDays table is as follows.

Working Days In Month = TOTALMTD(SUM('Working Days'[Number]),DATESMTD(DimDate[Date]))

 

ALL works well on the desktop version with no issues and I can publish and manually refresh no problems.

However when I schedule a refresh everything works apart from this measure and since I use this measure a lot in the report a lot of the visuals show (BLANK)

 

Any help would be greatly appreciated or any suggestions on an alternative way of doing working days in a month.

 

 

4 REPLIES 4
v-yuezhe-msft
Employee
Employee

@hweaves12,

I am not quite sure about your requirement. Why not directly use the “Working Days So Far This Month” measure to create visuals?  And in your Working Days In Month measure, you use the Number field, is the field same as NumberofDays?

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Not quite Lydia.

 

To let you understand what I am doing I'm trying to work out a simple forecast.

 

Sales for the month  / working Days So Far  *  total working days in month.

 

My calendar only goes up to todays date so if I set the week days to a 1 and the weekends to a 0,  I can calculate the number of working days from the beginning of the month to today no problem.

 

However since my dates only go up to today I cant use my dates table to work out the total number of working days this month.

Thats why I created a seperate table to hold that value.

 

But I think the real issue here is why should an immediate dataset refresh work ok with no issues but a scheduled refresh, although it says its completed, not be able to calculate one of my measures.

  

 

@hweaves12,

We will appreciate it if you can share the PBIX file for us to analyze.

Regards,

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Many, many, thanks for your help, i will supply it but at the moment Im trying to strip it back step by step to see where it fails.

Im still not exactly sure why the desktop version works and when published to the web part of it fails on a refresh. Its nothing to do with the data connections as I can edit the report online and pull data from any parts of the dataset.

Anyway I will let you know how I get on.

Again many thanks.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors