Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Suppose in this example I have a calculation group for cumulative sum
I would like to have a measure that can detect what the active calculation item is.
I notice that the Calculation Group can be accessed like a table in DAX. I create a measure to concatenate the measure names:
Detect CalcGroup = CONCATENATEX('CalcGroup Cumulative Sum', CONVERT( [Cumulative Sum Group], STRING), ",")
The card measure shows that it is working when both are not filtered out.
However, when only one is filtered, an error is shown:
I do not know why this is happening. As you can see in the DAX measure, I have purposely converted the [Cumulative Sum Group] column into a String just to see if this fixes the problem, but it does not. Also, it works fine for multiple values, but not for a single value. I was hoping to use this mechanism to detect which calculation group is active, is there any possibility of this working?
Solved! Go to Solution.
I have realized my error. The calculation item's calculation affects the measure that I am creating and it comes into play when a single calculation item is selected. A workaround is for each calculation item, if the SELECTEDMEASURENAME() equals to the measure name, return SELECTEDMEASURE().
I have realized my error. The calculation item's calculation affects the measure that I am creating and it comes into play when a single calculation item is selected. A workaround is for each calculation item, if the SELECTEDMEASURENAME() equals to the measure name, return SELECTEDMEASURE().
Hi @BZ_AF ,
Based on my research, it seems that the issue you are facing is due to the fact that the CONCATENATEX function requires at least two arguments to work properly. When only one value is filtered, the function is unable to concatenate the values and throws an error.
One possible solution to this issue is to use the SELECTEDVALUE function instead of the CONVERT function. The SELECTEDVALUE function returns the value of the specified column when there is only one distinct value in the filter context, and returns a blank when there are multiple distinct values.
Detect CalcGroup =
IF (
HASONEVALUE ( 'CalcGroup Cumulative Sum'[Cumulative Sum Group] ),
SELECTEDVALUE ( 'CalcGroup Cumulative Sum'[Cumulative Sum Group] ),
BLANK ()
)
This measure checks if there is only one distinct value in the filter context. If there is, it returns the value of the ‘Cumulative Sum Group’ column. If there are multiple distinct values, it returns a blank.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Unfortunately this solution doesn't seem to work.
I copied and pasted your measure and put it in a card. It shows (Blank) if >1 is selected. But if 1 is selected the same error occurs.
How do I attach a .pbix file? Trying to attach it here gives an error:
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |