Forum Discussion
Jilanisk29
Helper I
3 years agoPevious Financial YTD Base on the Financial Selection
Hi Team, I am trying to show the Sales Values for Current Financial YTD (CFYTD) and Previous Financial YTD (PFYTD), based on the Finacial Slicer (Prompt) Value Selection. I have implemented the log...
- 3 years ago
Thanks you so much rena, only expected is it has to be current date -1 for current year and same for last year also
- Anonymous3 years ago
Anonymous
3 years agoNot applicable
Hi Jilanisk29 ,
I updated your sample pbix file(see the attachment), please check if that is what you want.
01 Test YTD Sales =
VAR _today =
DATE ( 2023, 8, 20 )
RETURN
CALCULATE (
[01Sales],
DATESYTD ( 'Date'[Date], "30/4" ),
FILTER (
'Date',
'Date'[DateKey]
<> VALUE ( YEAR ( _today ) & FORMAT ( _today, "MM" ) & FORMAT ( _today, "DD" ) )
)
)01 Test LYTD Sales =
VAR _today =
DATE ( 2023, 8, 20 )
VAR _selfyear =
SELECTEDVALUE ( 'Date'[A_FiscalYear] )
VAR _months =
CALCULATETABLE (
VALUES ( 'Date'[MonthName] ),
FILTER ( ALL ( 'Date' ), 'Date'[A_FiscalYear] = _selfyear ),
FILTER ( 'Measure', NOT ( ISBLANK ( [01Sales] ) ) )
)
RETURN
CALCULATE (
[01 Test YTD Sales],
SAMEPERIODLASTYEAR ( 'Date'[Date] ),
FILTER (
ALL ( 'Date' ),
'Date'[MonthName]
IN _months
&& 'Date'[DateKey]
<> VALUE (
( YEAR ( _today ) - 1 )
& FORMAT ( _today, "mm" )
& FORMAT ( _today, "dd" )
)
)
)
Best Regards
Jilanisk29
Helper I
3 years agoHI rena,
Result are not shoing as expected for Last YTD. For Last Ytd it is showing for year current full month , it has to show only till today's date, Please see below attached Pbix file.
https://drive.google.com/file/d/13hntafemdBNsk7XgyfxOVUJ31pNH3VOJ/view?usp=sharing
- Anonymous3 years agoNot applicable
- Jilani3 years agoRegular Visitor
Thank You Rena, This was the solution , i am unable to see the Accept it as the solution button so i am conforming through sms this is the solution. Thanks a Lot