Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
enthousiastnick
Frequent Visitor

create a (calculated)column based on a selection with a unique value

Hi,

I have a column 'hours' that needs to be fild with a unique value .i.e. '18' for all records, regardless the other columns.
So every record needs to be 18

And with a slicer i want to change this value from 0 to 23

 

I have searched on the internet and forums and looked at powerQuery examples  or just create columns in the model to internet but there is no simple solutions. Does anyone have a solution for this?

9 REPLIES 9
enthousiastnick
Frequent Visitor

In my dataset i made a new column (as you suggested) named test = [Selected_value], default = 0;
The result is that only the default is shown, and using the slicer value stays 0

 

enthousiastnick_0-1710504725640.png

 

You misunderstood my solution. In Step 1 I said "Create a new Table" NOT a new Column. The whole example will add the value in a table visual, not in your dataset.

In other words, with my solution you create a selectable measure that you add to a visual Table or a Table matrix together with column from your dataset.

 

I hope it makes sense now.



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

I'm sorry I explained this not good enough. I did made a table:

enthousiastnick_0-1710506154064.png

Then: measure: 

Selected_value = SELECTEDVALUE('24_hour_tabel'[uren], 0)
Then:
slicer, based on table;
enthousiastnick_1-1710506306324.png

Then:

on the data-table where I need the column I add this column based on the measure:

enthousiastnick_2-1710506483704.png

 

I hope I explained it right?

 

We are spinning in circles 🙂 Your screenshot with the table is from your Table view and my solution is applicable in the Report view (see the attached screenshots).

Table_view.jpgReport_view_2.jpg

 



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

Ahhh well then this solution is not applicable for me. I want to add a column in the table and not in the report. I have already made a parameter (see already send picture second column on the right 'uurselectie'). But the thing is that in Tableau you can use a parameter as a column in the table and change it via a selection, in powerBI you can add the parametervalue in the table, but here you can not change the parameter value via een slicer/ selection in the view.

Many thanks for you time I appreciate this

I think Tableau is mixing things up a bit. In PowerBI you do the selection at Report level not at dataset level (or at least not that I'm aware of).

Cheers



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,
enthousiastnick
Frequent Visitor

I did what you described:

The selected value indeed changes, but the column test in my source table stays at the number I programmed in step 2 (in my case 1); Am I missing something?

 

enthousiastnick_0-1710496875839.png

 

What do you use for the test column? You must use a column from your dataset; in the example I made, the AccountID column is from my dataset, it is not an intermediate step.



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,
MNedix
Super User
Super User

Hi,

You can try the following:
Step 1. Create a new Table and generate the desired series.

ex: Value Selector = GENERATESERIES(0,23,1) - this will generate a series from 0 to 23 with increments of 1

Step 2. Read the selected value with the below measure:

Selected_Value =SELECTEDVALUE('Value selector'[Value],18) - this will read the Step 1 value BUT if nothing is selected it will return 18

Step 3. Make the Value selector a Tile or Drop-down Slicer

Step 4. Add the new measure to any table you want see the 2 screenshots

Selected Value_Default.jpgSelected Value_2.jpg

 

PS: if it solved your problem please mark it as the solution, this may help others looking for the same thing



If the post helped then please give it a Kudos and mark it as the solution so others can see it.
Cheers,

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.