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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Use parameter value for calculation using selected value

Hi,

Using the code below I get a result based on a calculation with the number 120000000.

In stead of that I tried using SELECTEDVALUE but no result.

Any help would be appreciated.

Cheers,

Herman

 

AandeelPerProduct =
ADDCOLUMNS(
CROSSJOIN( DISTINCT(dDate[FMaand]), VALUES(fCategories[PROD_Name])),
"Revenue",CALCULATE([Omzet],dDate[Fiscaal Jaar] = 2022),
"Pct",DIVIDE(CALCULATE([Omzet],dDate[Fiscaal Jaar] = 2022), CALCULATE([Omzet],dDate[Fiscaal Jaar] = 2022,ALL(fTransactions)))*120000000)
4 REPLIES 4
HughLa
Resolver IV
Resolver IV

Hi @Anonymous 

 

If I understand your question correctly, you want to replace the 120000000 with a what if parameter?

 

If so you can create a What-If parameter and use the parameter value measure that is generated when you create the what if parameter in your calculation.

 

It will look something like this:

HughLa_0-1679664283050.png

 

 

AandeelPerProduct =
ADDCOLUMNS(
CROSSJOINDISTINCT(dDate[FMaand]), VALUES(fCategories[PROD_Name])),
"Revenue",CALCULATE([Omzet],dDate[Fiscaal Jaar] = 2022),
"Pct",DIVIDE(CALCULATE([Omzet],dDate[Fiscaal Jaar] = 2022), CALCULATE([Omzet],dDate[Fiscaal Jaar] = 2022,ALL(fTransactions)))*[Parameter Value])
 
I hope this is what you are trying to achieve.
Hugh
Anonymous
Not applicable

Hi Hugh!

Thanks for your reply. I was thinking the same so I created a series of parameters like: 

Budget = GENERATESERIES(110000000, 130000000, 500000) and putting these in a slicer. I expected that using SELECTEDVALUE on this would work, but it doesn't. I tried INT as well to change it to a number, but to no avail.
Any other thoughts?
Cheers,
Herman

Hi Herman

 

When put the measure in a card visual does it show you selected value?

 

Like this:

HughLa_0-1679671992918.png

 

Can you maybe also share your selected value measure?

 

Regards

Hugh

 

Anonymous
Not applicable

Hi Hugh,

The selected value shows up in a card, see screenhot.

DAX code is: 

Geselecteerd = INT(SELECTEDVALUE(Budget[Budget]))

Haarms_0-1679672447906.png

The numbers you see are based on the hardcoded number 120000000.

On invoking this like in your example, nothing is showing up in the grid.

Cheers,

Herman

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.