Forum Discussion
x-axis alias on cumulative measure
- 8 years ago
Alright, i did some things. pictures at the bottom.
First of all, I created a calculated column with cumulative month values.
Then i changed the CV TFYTD measure.
Ignore the names of tables and columns*
Final resultCalc columnChanged allselected to affect entire table.
Column = IF(ArticleDeclaration[Custom]<2;"Jan"; IF(ArticleDeclaration[Custom]<3;"Jan-Feb"; IF(ArticleDeclaration[Custom]<4;"Jan-Mar"; IF(ArticleDeclaration[Custom]<5;"Jan-Apr"; IF(ArticleDeclaration[Custom]<6;"Jan-May"; IF(ArticleDeclaration[Custom]<7;"Jan-Jun"; IF(ArticleDeclaration[Custom]<8;"Jan-Jul"; IF(ArticleDeclaration[Custom]<9;"Jan-Aug"; IF(ArticleDeclaration[Custom]<10;"Jan-Sep"; IF(ArticleDeclaration[Custom]<11;"Jan-Oct"; IF(ArticleDeclaration[Custom]<12;"Jan-Nov"; "Jan-Dec" )))))))))))
Alright, i did some things. pictures at the bottom.
First of all, I created a calculated column with cumulative month values.
Then i changed the CV TFYTD measure.
Ignore the names of tables and columns*
Final resultCalc columnChanged allselected to affect entire table.
Column = IF(ArticleDeclaration[Custom]<2;"Jan";
IF(ArticleDeclaration[Custom]<3;"Jan-Feb";
IF(ArticleDeclaration[Custom]<4;"Jan-Mar";
IF(ArticleDeclaration[Custom]<5;"Jan-Apr";
IF(ArticleDeclaration[Custom]<6;"Jan-May";
IF(ArticleDeclaration[Custom]<7;"Jan-Jun";
IF(ArticleDeclaration[Custom]<8;"Jan-Jul";
IF(ArticleDeclaration[Custom]<9;"Jan-Aug";
IF(ArticleDeclaration[Custom]<10;"Jan-Sep";
IF(ArticleDeclaration[Custom]<11;"Jan-Oct";
IF(ArticleDeclaration[Custom]<12;"Jan-Nov";
"Jan-Dec"
)))))))))))
So does that meet your requirement?
Also, you may want to use the SWITCH function instead of nested IF statements. See this blog post to explain why/how
https://powerpivotpro.com/2012/06/dax-making-the-case-for-switch/
- Anonymous8 years agoNot applicable
Thanks johnmu,
Yes that was the other bit that made it take a while to digest.
tex described it as 'cumulative month values' which makes me think this is different to just switching the numbers to text values like you would with a SWITCH, but I'm going to need to spend some time understanding this code before I can say I understand whats going on.
- tex6288 years ago
Community Champion
I did not know of the Switch function! Will use it in the future :-)