MarkCBB
Active Member
- Joined
- Apr 12, 2010
- Messages
- 497
Hi there,
I have the following DAX Functions and all sems to work well, however when I cross highlight on a specific region, I get the following error:
(PBI Desktop)
Error Message:
MdxScript(Model) (1, 66) Calculation error in measure 'A_MEASURES'[LYTD Value]: Function 'SAMEPERIODLASTYEAR' only works with contiguous date selections.
Below are the DAX functions:
I have 3 Charts, Region, Product, Store.
When I click (Cross highlight) one of the items in the Region Chart the Product chart throws out that error, but the strange thing is that the Store chart doesnt.
Any Idea how to get past this?
I have been told to use a Calendar table, however when I change the MAIN_SALES[DATE] to Calendar[DATE] I get completely incorrect results. The Calendar Table has a relationship to the DATE in the MAIN_SALES Table (Date to Date). The MAIN_SALES table does not have alot of dates and there are gaps between the dates. The Calendar table that I created starts from the Year 1990 to 2030.
What I doing wrong?
I have the following DAX Functions and all sems to work well, however when I cross highlight on a specific region, I get the following error:
(PBI Desktop)
Error Message:
MdxScript(Model) (1, 66) Calculation error in measure 'A_MEASURES'[LYTD Value]: Function 'SAMEPERIODLASTYEAR' only works with contiguous date selections.
Below are the DAX functions:
Code:
TYTD Value = TOTALYTD ([Total Value];MAIN_SALES[DATE])
Code:
Total Value = SUM(MAIN_SALES[VALUE])
Code:
TYTD Growth Value = DIVIDE([TYTD Value]-[LYTD Value];[LYTD Value];0))
Code:
TYTD Value = TOTALYTD ([Total Value];MAIN_SALES[DATE])
Code:
LYTD Value = TOTALYTD ([Total value]; SAMEPERIODLASTYEAR( MAIN_SALES[Date]))
I have 3 Charts, Region, Product, Store.
When I click (Cross highlight) one of the items in the Region Chart the Product chart throws out that error, but the strange thing is that the Store chart doesnt.
Any Idea how to get past this?
I have been told to use a Calendar table, however when I change the MAIN_SALES[DATE] to Calendar[DATE] I get completely incorrect results. The Calendar Table has a relationship to the DATE in the MAIN_SALES Table (Date to Date). The MAIN_SALES table does not have alot of dates and there are gaps between the dates. The Calendar table that I created starts from the Year 1990 to 2030.
What I doing wrong?
Last edited: