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
Hi everyone,
Is there anyway to show the difference between years? Both Years/Months are in the same table, can someone please advise?
Solved! Go to Solution.
Hi @sraj,
You can try measure as:
Measure =
IF(
HASONEVALUE('Table'[Date]),
MAX('Table'[Sales]),
CALCULATE(
MAX('Table'[Sales]),
FILTER(
'Table',
YEAR('Table'[Date])=2021)
)-
CALCULATE(
MAX('Table'[Sales]),
FILTER(
'Table',
YEAR('Table'[Date])=2020)
)
)
Here is the output:
The pbix is attached.
If you still have some question, please don't hesitate to let me known.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
Hi @sraj,
Is this what you want?
If you still have some question, please don't hesitate to let me known.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
Yes, exactly this but the difference not the total.
Hi @sraj,
You can try measure as:
Measure =
IF(
HASONEVALUE('Table'[Date]),
MAX('Table'[Sales]),
CALCULATE(
MAX('Table'[Sales]),
FILTER(
'Table',
YEAR('Table'[Date])=2021)
)-
CALCULATE(
MAX('Table'[Sales]),
FILTER(
'Table',
YEAR('Table'[Date])=2020)
)
)
Here is the output:
The pbix is attached.
If you still have some question, please don't hesitate to let me known.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
Got it, thank you very much for your help!
Hi,
In the Row labels, show only the Month (not YearMonth). Furthermore, you should have a Calendar Table with a relationship from the Date column of your Data Table to the Date column of your Calendar Table. In your Calendar Table, write calculated column formulas to extract Year and YearMonth. To your visual, drag Year and YearMonth from the Calendar Table.
@sraj , the display you want needs month and year separately so that it can combine.
How do you want to diff between year and month?
You need to have a year month table, I sometimes create date from the year month and use date table. But you need separate table
Add month rank as column in table on year month
Month Rank = RANKX(all('Date'),'Date'[Month Start date],,ASC,Dense)
Month Rank = RANKX(all('Date'),'Date'[Year Month],,ASC,Dense)
This Month = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Month Rank]=max('Date'[Month Rank])))
Last Month = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Month Rank]=max('Date'[Month Rank])-1))
Last Year same month = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Month]=max('Period'[Month]) && 'Date'[Year]=max('Date'[Year])-1))
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA
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 |
---|---|
110 | |
95 | |
86 | |
78 | |
66 |
User | Count |
---|---|
157 | |
125 | |
116 | |
111 | |
95 |