cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
plukacsi
Helper I
Helper I

DATEADD -1 QTR returns blank values with monthly level fact table if I select only QTRs from Dates

 Dear All,

 

I have a really annoying problem. I have made the usual (Sales Prev.Quarter =
CALCULATE (
[Total Sales_2017],DATEADD(Dates[Date],-3,MONTH))

 

fuction and gives me blank if I change the filter context in the matrix to Quarter level from monthly level. If I put all the dates from dates table (daily level) and this measure connected to monthly level fact table then I get correct -3 Month numbers monthly, but 

If put only Quarters from date table than normal Total Sales sums up but Sales Prev.Quarter returns blank exept the total row.

 

Thank you for your help in advance!

 

BR,

Peter

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft
Microsoft

Hi @plukacsi,

 

Instead of using the Date_2[DateKey] column and fRedBox_ALL_BG[Month&Year] to built the relationship between the two tables, you'll need to two Date Type columns to create the relationship.

 

So you can firstly use the formula below add a new calculate column in fRedBox_ALL_BG table.

Date = DATE(fRedBox_ALL_BG[Year],fRedBox_ALL_BG[Month],1)

Then create the relationship with  Date_2[Date] column and fRedBox_ALL_BG[Date].

 

rs1.PNG

 

And the [Sales Prev.Quarter] measure will work as expected.

 

r4.PNG

 

Here is the modified pbix file for your reference. Smiley Happy

 

Regards

View solution in original post

4 REPLIES 4
v-ljerr-msft
Microsoft
Microsoft

Hi @plukacsi,

 

Instead of using the Date_2[DateKey] column and fRedBox_ALL_BG[Month&Year] to built the relationship between the two tables, you'll need to two Date Type columns to create the relationship.

 

So you can firstly use the formula below add a new calculate column in fRedBox_ALL_BG table.

Date = DATE(fRedBox_ALL_BG[Year],fRedBox_ALL_BG[Month],1)

Then create the relationship with  Date_2[Date] column and fRedBox_ALL_BG[Date].

 

rs1.PNG

 

And the [Sales Prev.Quarter] measure will work as expected.

 

r4.PNG

 

Here is the modified pbix file for your reference. Smiley Happy

 

Regards

Awsome! Thank you!

 

So Date data type one both side is bloody important. 🙂

 

BR,

Peter

v-ljerr-msft
Microsoft
Microsoft

Hi @plukacsi,

 

According to your description above, I have created a measure below, and it works fine at Quarter level.

Sales Prev.Quarter = CALCULATE([Total Sales],DATEADD('Date'[Date],-3,MONTH))

r4.PNG

 

Could you share a dummy pbix file which can reproduce the issue, so that we can further assist on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploadingSmiley Happy

 

Regards

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors