Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi, I'm pretty new to PowerBI and I appreciate this forum to share experiences.
I've a problem with a measure not displaying the correct value. I've a fact table called Summary in which I've the field [Prepared Quantity] on wich I've created this measure:
Deliberated Lines TOT = CALCULATE(SUM('Summary'[Prepared Quantity]), GROUPBY('Summary','Summary'[Planned Delivery Date],'Summary'[Shipment Type],'Summary'[FLG Prep]))
where [Planned Delivery Date] is a non-unique field of type date.
What I would like to do is displaying the same value but one year before the selected date or the date in the visual row. I tried to use the SAMEPERIODLASTYEAR with [Planned Delivery Date] but it gave me an error because the date rows are not unique. So I added a calendar table in order to do that and I linked the [Planned Delivery Date Id] field to the calendar key of the calendar dimension. After that I've created this measure:
Deliberated Lines TOT Previous Year = CALCULATE('Summary'[Deliberated Lines TOT],ALL('Calendar'[Date Value]),SAMEPERIODLASTYEAR('Calendar'[Date Value]))
but it shows me the same value of the [Deliberated Lines TOT] measure.
Here's a screenshot:
What I'm doing wrong?
Thanks in advance
Solved! Go to Solution.
For Week in Year Number make sure tgat you select "Do not summarize" also make sure that 'Calendar' is marked as date table with Date Value as the date column. Then the following should technically work.
Deliberated Lines TOT Previous Year =
CALCULATE (
'Summary'[Deliberated Lines TOT],
ALL ( 'Calendar' ),
SAMEPERIODLASTYEAR ( 'Calendar'[Date Value] )
)
Hi @MarcoT
In your table visual, Instead of Planned Delivery Date please use 'Calendar'[Date] and instead of Week Planned Delivery Date use 'Calender'[Week Number]
Hi, I've done it but now but unfortunately it shows no results. Here's a screenshot:
For Week in Year Number make sure tgat you select "Do not summarize" also make sure that 'Calendar' is marked as date table with Date Value as the date column. Then the following should technically work.
Deliberated Lines TOT Previous Year =
CALCULATE (
'Summary'[Deliberated Lines TOT],
ALL ( 'Calendar' ),
SAMEPERIODLASTYEAR ( 'Calendar'[Date Value] )
)
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
14 | |
10 | |
7 |