cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
affan Established Member
Established Member

Value not in current period but in last period - rows are hidden

Hi,

 

I am working on a report where I am having a comparison of current year's production quantity and last year production quantity. 

 

I have three columns
1. Material

2. Quantity

3. Date

 

I am making a comparison of items using the simple measure

 

Current Qty= SUM('Table1'[Quantity])

For last year 

CALCULATE([Current Qty],SAMEPERIODLASTYEAR('Date'[Date])

 

The issue I am facing is when I have an item produced in last but it is not in the current year, the row is not shown in the data.

 

I have tried show items with no data on the 'Material' field. It does not help as it starts showing the items even with no values in both periods.

 

Thanking for any help in advance Smiley Happy

 

Regards,

Affan

1 ACCEPTED SOLUTION

Accepted Solutions
affan Established Member
Established Member

Re: Value not in current period but in last period - rows are hidden

I have reached to the solution by using the ISBLANK function.

 

I have updated my current period quantity formula as below.

 

 

Quantity = var qty=CALCULATE([Current Qty],SAMEPERIODLASTYEAR('Date'[Date])

return
 IF(ISBLANK(qty),0,qty)

 

 

 

3 REPLIES 3
Community Support Team
Community Support Team

Re: Value not in current period but in last period - rows are hidden

hi, @affan

     I have tested on my side, but not reproduce the issue.

For example:

there is production on 2017/11 and 2017/12 and there is no production on 2018/11 and 2018/12, it works well.

 

5.PNG

Please share your sample pbix and expected output. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.

 

 

Best Regards,

Lin

 

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

Re: Value not in current period but in last period - rows are hidden

Hi @v-lili6-msft,

 

Thanks for your response. The issue is when I add the Material, Quantity and Quantity LY to a table visual. It filters out those items which have no transaction in the current period. The example you have shown is a bit different.

 

Regards,

Affan

affan Established Member
Established Member

Re: Value not in current period but in last period - rows are hidden

I have reached to the solution by using the ISBLANK function.

 

I have updated my current period quantity formula as below.

 

 

Quantity = var qty=CALCULATE([Current Qty],SAMEPERIODLASTYEAR('Date'[Date])

return
 IF(ISBLANK(qty),0,qty)