cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

New Member

## 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 =
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
Resolver IV

Hi @Haarms

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:

AandeelPerProduct =
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
New Member

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
Resolver IV

Hi Herman

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

Like this:

Can you maybe also share your selected value measure?

Regards

Hugh

New Member

Hi Hugh,

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

DAX code is:

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

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors