Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
I have two Measure none of them work when I try to use them with the category to get Last Year's Cost vs. Current Year Comparison. I need to show the comparison between the categories.
Solved! Go to Solution.
@rahulvyas , You should always use Date table in visual, measure and slicers . Make sure date table has all dates, marked as date table and period from date table is used in visual and slicers
example
LY COST =
CALCULATE( [$CostBeforeTax] ,DATESYTD(DATEADD('Date'[SnapshotDate],-1, Year))))
LY COST =
CALCULATE( [$CostBeforeTax] ,(DATEADD('Date'[SnapshotDate],-1, Year)))
LYTD COST =
CALCULATE( [$CostBeforeTax] ,DATESYTD(DATEADD('Date'[SnapshotDate],-1, Year), "10/31"))
Alternate Formula 2
LAST YTD SALES = CALCULATE(SUM(AzureBilling[CostBeforeTax]), DATESYTD(DATEADD('Date'[SnapshotDate],-1, YEAR), "10/31"))
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Hi @rahulvyas ,
Like @amitchandak said, your two measures are written based on time, that should use Date table in visual
I have created a simple sample, please refer to.
Measure:
Measure = CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[date]=SELECTEDVALUE('Table'[date])))
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@rahulvyas , You should always use Date table in visual, measure and slicers . Make sure date table has all dates, marked as date table and period from date table is used in visual and slicers
example
LY COST =
CALCULATE( [$CostBeforeTax] ,DATESYTD(DATEADD('Date'[SnapshotDate],-1, Year))))
LY COST =
CALCULATE( [$CostBeforeTax] ,(DATEADD('Date'[SnapshotDate],-1, Year)))
LYTD COST =
CALCULATE( [$CostBeforeTax] ,DATESYTD(DATEADD('Date'[SnapshotDate],-1, Year), "10/31"))
Alternate Formula 2
LAST YTD SALES = CALCULATE(SUM(AzureBilling[CostBeforeTax]), DATESYTD(DATEADD('Date'[SnapshotDate],-1, YEAR), "10/31"))
Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |