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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Krcmajster
Helper IV
Helper IV

DAX Function for custom data.

Hi, 

 

Is there are dax function where I can store values which one I want without storing it in a table?

Something like Data validation in excel as I need it for the dropdown.

 

I need to store 2 values, "Weighted" and "Unweighted". Usually I would create a table with only those 2 values but I want to know if there is a way to do this wth function.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Krcmajster,

 

You can direct define it in var function to store these parameter as list.

 

Sample:

Measure=
var _list= {"Weighted","Unweighted"} 
return
IF(selectedvalue(Table[Column]) in _list, "Y","N")

Notice: they can only used in current measure itself and you can't get this variable list from outside.

 

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Krcmajster,

 

You can direct define it in var function to store these parameter as list.

 

Sample:

Measure=
var _list= {"Weighted","Unweighted"} 
return
IF(selectedvalue(Table[Column]) in _list, "Y","N")

Notice: they can only used in current measure itself and you can't get this variable list from outside.

 

Regards,

Xiaoxin Sheng

PattemManohar
Community Champion
Community Champion

@Krcmajster You can create a variable and store those two values as a list. But again it will be global outside that DAX calculation, that means you need to do everytime in all DAX calculations where you require those list. In Power Query, you can create a LIST that can be accessible while filtering/parameterizing other tables as well.





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors