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
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
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.