Forum Discussion
Variance % in Line and Bar Stacked Bar
Hi All,
I'm triyng to populated the variance % for the below visual but not getting the desired result.
Ideally from 5 to10 it should show then 100%( (10-5)/10) from 10 to16 it should show 60% ( 16-10/10) but the measure is not working for me.
Any help here?
- Anonymous2 years ago
Hi Anonymous ,
Try this:
Measure = var _table=ADDCOLUMNS(SUMMARIZE(ALLSELECTED(VW_D_DATE),[WEEK_END_DATE]),"test",[Assessment L6W_1]) var _pre= MAXX(FILTER(_table,[WEEK_END_DATE]=MAX(VW_D_DATE[WEEK_END_DATE])-7),[test]) var _current=[Assessment L6W_1] var _percent=DIVIDE(_current-_pre,_pre,0) RETURN _percentBest Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- AnonymousNot applicable
Hi Anonymous ,
Please try to create three measures.
Current=MAXX(FILTER(ALL(VW_D_DATE),VW_D_DATE[WEEK_END_DATE]=MAX(VW_D_DATE[WEEK_END_DATE])),[Assessment L6W_1])Pre=MAXX(FILTER(ALL(VW_D_DATE),VW_D_DATE[WEEK_END_DATE]=MAX(VW_D_DATE[WEEK_END_DATE])-1),[Assessment L6W_1])Percent=DIVIDE([Current]-[Pre],[Pre],0)If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi,
Thanks for the update. Still getting the same issue.
Below is the link to the PBIX file
https://drive.google.com/file/d/1RHuQ6en6kJiPZ62j6Nwvvm3k4dXA0xBR/view?usp=sharing- AnonymousNot applicable
Hi Anonymous ,
Try this:
Measure = var _table=ADDCOLUMNS(SUMMARIZE(ALLSELECTED(VW_D_DATE),[WEEK_END_DATE]),"test",[Assessment L6W_1]) var _pre= MAXX(FILTER(_table,[WEEK_END_DATE]=MAX(VW_D_DATE[WEEK_END_DATE])-7),[test]) var _current=[Assessment L6W_1] var _percent=DIVIDE(_current-_pre,_pre,0) RETURN _percentBest Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.