Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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 🙂
Regards,
Affan
Solved! Go to Solution.
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)
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)
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.
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
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
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |