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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
klehar
Helper V
Helper V

What if parameter doesn't calculate the right results

Hi,

 

I'm trying to calculate a column called Amount 2 which would be Amount * Percent

I want the percent value to come from 'What If' parameter
I also want this to be a part of a new table and hence i have written an addcolumns function.

I want that when i change my 'what if' slicer, it should change Amount 2, but it always resorts to the default value of 20% (0.2)

 

PBIX File Link:

 

 

 

Calc Table = 
VAR Percent1 = 'Percent'[Percent Value] 
/*
Percent value comes from my What if paramter
Percent Value = SELECTEDVALUE('Percent'[Percent], 0.2)
Percent = GENERATESERIES(CURRENCY(0), CURRENCY(1), CURRENCY(0.01))
*/

RETURN
ADDCOLUMNS('Table',
"Amount 2", 'Table'[Amount] * Percent1)

 

 

 

 

Result:

klehar_0-1618991301697.png

 

 

 

1 ACCEPTED SOLUTION
v-yetao1-msft
Community Support
Community Support

Hi @klehar ,

Because the value of what if parameter is dynamic, multiplying the value of what if by the value of another column can only create a measure .

Amount 2 = SUM('Table'[Amount ])*'Percent 1'[Percent 1 Value]

If you do not specify a value, it is the default value 0.2 . Otherwise, the specified value is multiplied by the column .

The effect is as shown:

Ailsa-msft_0-1619141191117.png

Ailsa-msft_1-1619141191120.png

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yetao1-msft
Community Support
Community Support

Hi @klehar ,

Because the value of what if parameter is dynamic, multiplying the value of what if by the value of another column can only create a measure .

Amount 2 = SUM('Table'[Amount ])*'Percent 1'[Percent 1 Value]

If you do not specify a value, it is the default value 0.2 . Otherwise, the specified value is multiplied by the column .

The effect is as shown:

Ailsa-msft_0-1619141191117.png

Ailsa-msft_1-1619141191120.png

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

klehar
Helper V
Helper V

@PhilipTreacy  or @Phil_Seamark or @Greg_Deckler can you please help. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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