Forum Discussion
DAX help
I would like to display the data in the matrix table as follows. The measure values should display the YTD vs PYTD for country level, and loc wise it should be only YTD value.
How to achive this? Any suggestions.
| YTD vs PYYTD | |
| Country1 | 20% vs 23% |
| Loc1 | 20% |
| Loc2 | 19% |
| Loc3 | 21% |
| Country2 | 23% vs 24% |
| Loc1 | 24% |
| Loc2 | 22% |
| Loc3 | 23% |
8 Replies
- amitchandakSuper User
Naveen29 , with help from a date table create a measure like
example
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA - Naveen29Helper II
amitchandak thanks, I know YTD and PYTD calucations. My question was more about how to display two measures in the same column depedens on the lookup value.
- Samarth_18Community Champion
Hi Naveen29 ,
Have you tried below code:-
Measure = [YTD]&" "&[PYYTD]Note:- [YTD] and [PYYTD] represnt your measure for particular calculation.
Thanks,
Samarth
- Syndicate_AdminAdministrator
this is fine. How to show only YTD in the values
- Samarth_18Community Champion
Syndicate_Admin For that you dont need to create a seperate measure, you can directly drag YTD measure.