Forum Discussion
Timeline or replacement
- 8 years ago
Yes you can do many things with the code. It simply builds up a string based on your rules.
So it can change the Characters based on the status.
So you can have severval variables for the different Statuses
VAR __FULLCHARState1 = 9679 -- State1
VAR __FULLCHARState2 = 128523 -- State2
VAR __FULLCHARState3 = 128546 -- State3Then you can conditionally Set _FULLCHAR or even build the string using a mixture of Characters
The return basically repeates the blank Char to get to the start then the required char for the duration. However it can be adapted to do anything you want.
IF( NOT ISBLANK(__BASE_VALUE), REPT(UNICHAR(__BLANKCHAR), __START_RATING) & REPT(UNICHAR(__FULLCHAR), __BASE_RATING) )Its a variation on cwebb Star Rating Dax http://community.powerbi.com/t5/Quick-Measures-Gallery/Star-Ratings/m-p/166903
He's also got a links to a blog post with other variations.
Play around with the Expressions. If you download my example it has a number of examples and a data set to play with.
GanttDot = VAR __MAX_NUMBER_OF_BLOCKS = 100 VAR __MIN_RATED_VALUE = 0 VAR __STARTBASE_VALUE = MIN(Durations[StartTime]) VAR __BASE_VALUE = Sum(Durations[Minutes]) VAR __MAX_RATED_VALUE = CALCULATE(MAX(Durations[EndTime]), ALL(Durations)) -- Monospace characters VAR __BLANKCHAR = 32 -- Space VAR __FULLCHAR = 9679 -- Dot VAR __NORMALIZED_STARTBASE_VALUE = MIN( MAX( DIVIDE( __STARTBASE_VALUE - __MIN_RATED_VALUE, __MAX_RATED_VALUE - __MIN_RATED_VALUE ), 0 ), 1 ) VAR __NORMALIZED_BASE_VALUE = MIN( MAX( DIVIDE( __BASE_VALUE - __MIN_RATED_VALUE, __MAX_RATED_VALUE - __MIN_RATED_VALUE ), 0 ), 1 ) VAR __START_RATING = ROUND(__NORMALIZED_STARTBASE_VALUE * __MAX_NUMBER_OF_BLOCKS, 0) VAR __BASE_RATING = MAX(ROUND(__NORMALIZED_BASE_VALUE * __MAX_NUMBER_OF_BLOCKS, 0),1) RETURN IF( NOT ISBLANK(__BASE_VALUE), REPT(UNICHAR(__BLANKCHAR), __START_RATING) & REPT(UNICHAR(__FULLCHAR), __BASE_RATING) )
Do you have an idea what you want it to look like?
You might get some ideas from my SSIS Dashboard. I was looking for a time based Gantt chart and tried some in R but ended up create a dax text version. I've also got some other time based charts, though I tend to sumerised by either hour or 15 min counters. These let me plot onto a scatter chart.
http://community.powerbi.com/t5/Data-Stories-Gallery/SSIS-Catalog-DB-Dashboard/m-p/244677#M1110
I like the new Ribbon chart for showing change over time.
- Anonymous8 years agoNot applicable
Hi stretcharm,
Thank you for you response, that looks impressive!
It would be great to be able to create a text gantt chart for my problem. But is it able to replace the tasks with a "status", which don't repeat in the list? E.g. we use the status of skype (Online, Busy, Away, Offline), would it be possible only use 4 rows, and change the "dots" of the gantt chart between rows? Sorry if it is cryptic, not a native English speaker :P
- stretcharm8 years agoMemorable Member
Yes you can do many things with the code. It simply builds up a string based on your rules.
So it can change the Characters based on the status.
So you can have severval variables for the different Statuses
VAR __FULLCHARState1 = 9679 -- State1
VAR __FULLCHARState2 = 128523 -- State2
VAR __FULLCHARState3 = 128546 -- State3Then you can conditionally Set _FULLCHAR or even build the string using a mixture of Characters
The return basically repeates the blank Char to get to the start then the required char for the duration. However it can be adapted to do anything you want.
IF( NOT ISBLANK(__BASE_VALUE), REPT(UNICHAR(__BLANKCHAR), __START_RATING) & REPT(UNICHAR(__FULLCHAR), __BASE_RATING) )Its a variation on cwebb Star Rating Dax http://community.powerbi.com/t5/Quick-Measures-Gallery/Star-Ratings/m-p/166903
He's also got a links to a blog post with other variations.
Play around with the Expressions. If you download my example it has a number of examples and a data set to play with.
GanttDot = VAR __MAX_NUMBER_OF_BLOCKS = 100 VAR __MIN_RATED_VALUE = 0 VAR __STARTBASE_VALUE = MIN(Durations[StartTime]) VAR __BASE_VALUE = Sum(Durations[Minutes]) VAR __MAX_RATED_VALUE = CALCULATE(MAX(Durations[EndTime]), ALL(Durations)) -- Monospace characters VAR __BLANKCHAR = 32 -- Space VAR __FULLCHAR = 9679 -- Dot VAR __NORMALIZED_STARTBASE_VALUE = MIN( MAX( DIVIDE( __STARTBASE_VALUE - __MIN_RATED_VALUE, __MAX_RATED_VALUE - __MIN_RATED_VALUE ), 0 ), 1 ) VAR __NORMALIZED_BASE_VALUE = MIN( MAX( DIVIDE( __BASE_VALUE - __MIN_RATED_VALUE, __MAX_RATED_VALUE - __MIN_RATED_VALUE ), 0 ), 1 ) VAR __START_RATING = ROUND(__NORMALIZED_STARTBASE_VALUE * __MAX_NUMBER_OF_BLOCKS, 0) VAR __BASE_RATING = MAX(ROUND(__NORMALIZED_BASE_VALUE * __MAX_NUMBER_OF_BLOCKS, 0),1) RETURN IF( NOT ISBLANK(__BASE_VALUE), REPT(UNICHAR(__BLANKCHAR), __START_RATING) & REPT(UNICHAR(__FULLCHAR), __BASE_RATING) )- Anonymous8 years agoNot applicable
Thank you very much stretcharm, i will play around with it for a bit!