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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Gauteweb
Advocate II
Advocate II

What-if and measure coloum

Hi. So I'm struggling a bit with this:

We have a product that we sell with a package price per 100.000 items, so I have these coloums in a table:

Items
- just plain values
Packages(ROUNDUP(('Table'[Items] / 100000),0)

 

I then created a what-if with prices from 1 to 50 in a new Coloum called Cost and added a following coloum:

 

Price
var _sel = SELECTEDVALUE('Cost'[Item Cost])
return
(ROUNDUP(('Table'[Items] / 100000),0) * _sel)

The problem now is that the Price only uses the default value I put in the What-if. If I create a What-if without a default value, the Price coloum is always empty.


I've tried many different approaches to the problem, but no matter what I do, the measure coloum Price always uses the default what-if value, now the value the user selects.

 

1 ACCEPTED SOLUTION

@Gauteweb, Try the below DAX in a measure,

Euro_M = SUM(AgentMethodUsage[Packages]) * 'Price'[Price Value]

View solution in original post

5 REPLIES 5
Gauteweb
Advocate II
Advocate II

Here is the PBIX file (didn't find any way to upload it to the community)

https://www.jottacloud.com/s/02319ee04087c4248d38a345ad60f902580 

@Gauteweb, Try the below DAX in a measure,

Euro_M = SUM(AgentMethodUsage[Packages]) * 'Price'[Price Value]

Thanks, that worked like a charm!

SivaMani
Resident Rockstar
Resident Rockstar

@Gauteweb,

 

Did you create a calculated Column or measure? Share the pbix file if possible.

Hi. Sorry, I ment Calculated Column. 

I need to clean up the pbix file before I can share it, to much sensitive info 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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