Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
User | Count |
---|---|
126 | |
78 | |
78 | |
59 | |
51 |
User | Count |
---|---|
165 | |
83 | |
68 | |
68 | |
59 |