Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I have en existing measure called [O_VOL_ACT] and from this measure I derived several other measures like previous year and many others (Time Intelligent)..:
[O_VOL_ACT]
[0_VOL_ACT_PYTD] = Previous Year To Date
[O_VOL_ACT_PY] = Previous Year
[O_VOL_ACT_PY_DEV] = Deviation between Previous- Actual Year
[O_VOL_ACT_PY_DOW] = Previous Year Day of Week
[O_VOL_ACT_YTD] = Actual Year To Date
......
Now, what I try to archiv is, that I can compile the measurename by doint something like concatenate the base measure [O_VOL_ACT] with any suffix of the derived measures like _PY.
As a Result I want to get something like [O_VOL_ACT_PY] which I could use for example in a matrix.
Based on outside criteria (IF/ELSE) suffix _PY or _PY_DOW must come to action.
Of course, concatenate doesn't work! Any other ideas how to solve this issue ?
Regards
Alex
Solved! Go to Solution.
You can achieve that with calculated groups.
I would probably do calculated groups to select 2nd measure to compare with actual and then use visual Column Chart with Relative Variance
So in this proposed solution you have actual added in visual and then another measure that changes value based on users selection.
Hi, @Anonymous
The requirement is to be able to switch the previous time selection between "previous year" and "previous year day of week".
At the end the user should be able to tick a switch and see eighter the upper- or lower variant of comparision.
Based on what I got above, the calculation group would be a good choice.
e.g.
Refer:
Introducing Calculation Groups
You can also use the Switch function with slicers
e.g.
Switch(
True(),
SelectedValue="PY",[O_VOL_ACT_PY],
SelectedValue="PYTD",[0_VOL_ACT_PYTD]
)
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I already solved my issue. But your solution with the "Switch" and "SelectedValue" is great. Will add that to my list of (best) code snippets :-).
Thanks
Hi @Anonymous
Whwn you say "Based on outside criteria (IF/ELSE) suffix _PY or _PY_DOW must come to action." what do you mean by "outside"?
Hey,
A bit unclear of the reason for such measure but perhaps Calculated Groups could work
e.g. final solution would give user a filter to choose what you they want to see PYTD, PY, etc. and depending on that you would give result
Calculated groups could have two measures, one to show text: using SWITCH, if SELECTEDMEASURE = PY then "PY" and etc.
and another to show correct value.
https://community.powerbi.com/t5/Desktop/using-calculation-item-in-another-calculation-items-Time/m-...
https://community.powerbi.com/t5/Desktop/Extract-name-calculation-item-from-calculation-group/m-p/16...
The requirement is to be able to switch the previous time selection between "previous year" and "previous year day of week".
At the end the user should be able to tick a switch and see eighter the upper- or lower variant of comparision.
Calc-Group wont work.
You can achieve that with calculated groups.
I would probably do calculated groups to select 2nd measure to compare with actual and then use visual Column Chart with Relative Variance
So in this proposed solution you have actual added in visual and then another measure that changes value based on users selection.
I could solve my problem with Calculation Groups, so you where right 😉 !!
Thanks for the hint.
I created an overview pic which more or less should explain my created solution.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
12 | |
10 | |
10 | |
9 |