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 All,
I have below mentioned data table, I need to create a comparison between current year spend vs. previous year spend based on the multiple value selected in the dynamic filter.
DAX queries created so far:-
Data1 and Data2
Period Table
Dynamic Filter & Output
Solved! Go to Solution.
Hi @Saibal_78
First, add a column with this code to convert your period to date format:
Date =
DATE ( LEFT ( 'Table'[Period], 4 ), RIGHT ( 'Table'[Period], 2 ), 01 )
Then use this Measure to find last year amount:
Previous Period Spend =
CALCULATE (
SUM ( 'Table'[Spend] ),
REMOVEFILTERS ( 'Table'[Period] ),
SAMEPERIODLASTYEAR ( 'Table'[Date] )
)
For Current Period Spend, you don't need to use Measure. Just add the spend column to the card visual.
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Not working, it's showing full year spend
I see the issue is I have selected Period, I should have selected Date in the slicer instead of Period, Thanks
yes 202101 and 202102
Try this:
Previous Period Spend =
CALCULATE (
SUM ( 'Table'[Spend] ),
SAMEPERIODLASTYEAR ( 'Table'[Date] )
)
Hi @Saibal_78
First, add a column with this code to convert your period to date format:
Date =
DATE ( LEFT ( 'Table'[Period], 4 ), RIGHT ( 'Table'[Period], 2 ), 01 )
Then use this Measure to find last year amount:
Previous Period Spend =
CALCULATE (
SUM ( 'Table'[Spend] ),
REMOVEFILTERS ( 'Table'[Period] ),
SAMEPERIODLASTYEAR ( 'Table'[Date] )
)
For Current Period Spend, you don't need to use Measure. Just add the spend column to the card visual.
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
14 | |
10 | |
7 |