Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all
Im a new user of PowerBI Desktop, and faced an issue.
I need to create a monhtly basis report.
The starting day from date table has a relationship with day column in calendar day table
YYYYMM from DATE table has relationship with sales tables YYYYMM column
Made some measure: for example:
Sales USD= calculate(sum('SALES 1'[Amount USD]),filter('SALES 1','SALES 1[PnL row]="NSV"), filter('SALES 1', 'SALES 1'[Type of data]="ACTUAL"))/1000
SALES USD Last year= calculate([SALES USD],SAMEPERIODLASTYEAR('CALENDAR DAY'[DAY]))
When I select 1 month and 1 year both measure is perfect.. but if Im selecting more month the Last Year measure doesnt show anything
Where the issue should be?
Solved! Go to Solution.
Hi @AndreaBac
You are using a Time intelligence formula SAMEPERIODLASTYEAR towards the Calendar Day table. for the formula to be accurate needs to use a column where there is MMDDYYYY. so the relationships between your Tables needs to be changed to columns where there is YYYYMMDD like in your Model.
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
Hi,
You should not have a Date Table and a Calendar day Table. Just have a Calendar table with running dates. Using calculated column formulas, you must have Year, Month Name and Month number columns as well. Sort the Month Name by the Month number column. Create a relationship from the Date column of your Sales table to the Date column of your Calendar Table. To your visual/filter/slicer, drag any and all date dimensions only from the Calendar Table. Select any one Year and Month Name. Your measures can be simplified to:
Sales USD= calculate(sum('SALES 1'[Amount USD]),'SALES 1[PnL row]="NSV",'SALES 1'[Type of data]="ACTUAL")/1000
SALES USD Last year= calculate([SALES USD],SAMEPERIODLASTYEAR('CALENDAR DAY'[Date]))
Hope this helps.
Thanks, that solved my issue!
Hi,
You should not have a Date Table and a Calendar day Table. Just have a Calendar table with running dates. Using calculated column formulas, you must have Year, Month Name and Month number columns as well. Sort the Month Name by the Month number column. Create a relationship from the Date column of your Sales table to the Date column of your Calendar Table. To your visual/filter/slicer, drag any and all date dimensions only from the Calendar Table. Select any one Year and Month Name. Your measures can be simplified to:
Sales USD= calculate(sum('SALES 1'[Amount USD]),'SALES 1[PnL row]="NSV",'SALES 1'[Type of data]="ACTUAL")/1000
SALES USD Last year= calculate([SALES USD],SAMEPERIODLASTYEAR('CALENDAR DAY'[Date]))
Hope this helps.
Hi @AndreaBac
You are using a Time intelligence formula SAMEPERIODLASTYEAR towards the Calendar Day table. for the formula to be accurate needs to use a column where there is MMDDYYYY. so the relationships between your Tables needs to be changed to columns where there is YYYYMMDD like in your Model.
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
114 | |
98 | |
96 | |
68 | |
67 |