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
Anonymous
Not applicable

Price margin calculator

Hello, 

 

I monitor the productmargin in PowerBI based on customer and product niveau. 

I want to know what the marge will be when i change the price of my products. 

I think i can fix this with a parameter, for example a X% price difference. 

But i want to use this price changes only on the selected products or customers (slicer).

Is this possible or how can I build this in PBI. 

 

Or maybe someone have another idea to fix this? 

 

Example data: 

Knipsel.PNG

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

Hi @Anonymous ,

You can create two tables(customer no, item no, no relationship to original tables) as source of slicers. Then write a measure to get calculate result from these slicers:

Changed =
VAR _sItem =
    ALLSELECTED ( Item[Item_No] )
VAR _sCust =
    ALLSELECTED ( Customer[Cust_No] )
VAR _Price =
    SELECTEDVALUE ( Table[Percent] )
VAR _totalSales =
    MAX ( Sample[Price] ) / MAX ( Sample[Margin] )
        * MAX ( Sample[Quantiy] )
RETURN
    IF (
        MAX ( Sample[Cust_No] ) IN _sCust
            && MAX ( Sample[Item_No] ) IN _sItem,
        _totalSales * _price,
        _totalSales
    )

If above not help, please share a pbix file with sample data and expected result for further test.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @Anonymous ,

You can create two tables(customer no, item no, no relationship to original tables) as source of slicers. Then write a measure to get calculate result from these slicers:

Changed =
VAR _sItem =
    ALLSELECTED ( Item[Item_No] )
VAR _sCust =
    ALLSELECTED ( Customer[Cust_No] )
VAR _Price =
    SELECTEDVALUE ( Table[Percent] )
VAR _totalSales =
    MAX ( Sample[Price] ) / MAX ( Sample[Margin] )
        * MAX ( Sample[Quantiy] )
RETURN
    IF (
        MAX ( Sample[Cust_No] ) IN _sCust
            && MAX ( Sample[Item_No] ) IN _sItem,
        _totalSales * _price,
        _totalSales
    )

If above not help, please share a pbix file with sample data and expected result for further test.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
v-shex-msft
Community Support
Community Support

Hi @Anonymous ,

What parameter you mean? 'Query parameter' or 'what if' parameter? If you mean 'what if' parameter, it is possible. You can write a measure to calculate current row contents with selected value.

If you mean query parameter, normally slicer/filter can't interact with query parameters. You need to turn on enable 'load option' to load it as a table, then you can use it calculate with selected records.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

What - if parameter, 

But i can't fix it

Anonymous
Not applicable

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.