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
Viper1451
Frequent Visitor

Budgetprices with different Hierarchy

Hi all,

 

I just started with Power BI and did some basic courses to create measures and dashboard and I'm helping a friend now to create a dashboard. He's working in the concrete business and having budget prices on a different hierarchy. I just created this test file to explain the issue:

 

https://1drv.ms/u/s!Au2iuCVIX0mrgbE6BaK-Z4RX6H_ScA?e=YwBXNj

 

So these are the data tables I'm using (of course with a datetable):

Screenshot PBI.png

So he sells items to his customer, but the budgetprices are on productgroup level. I've created the next measure to calculate the Budget Revenue:

Budget Revenue = SUMX(fOrder;fOrder[QtyOrdered]*RELATED(dProductTable[Weight in kg])*MAX(fBudget[Budget Price per kg]))
 
Which returns the next values:
Screenshot PBI 2.png
The total should be €2.215,58 instead of €3.506 and it is taking the budgetprice of the highest year. Hopefully anyone can help and don't hesitate to contact for more details, if my question isn't clear.
 
Thanks for any feedback!
 
 
1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @Viper1451 ,

 

You need a date condition, add a filter in it.

Budget Revenue =
SUMX (
    fOrder,
    fOrder[QtyOrdered] * RELATED ( dProductTable[Weight in kg] )
        * (
            CALCULATE (
                MAX ( fBudget[Budget Price per kg] ),
                FILTER ( fBudget, YEAR ( fBudget[Date] ) = YEAR ( fOrder[OrderDate] ) )
            )
        )
)

Here is the result.
1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @Viper1451 ,

 

You need a date condition, add a filter in it.

Budget Revenue =
SUMX (
    fOrder,
    fOrder[QtyOrdered] * RELATED ( dProductTable[Weight in kg] )
        * (
            CALCULATE (
                MAX ( fBudget[Budget Price per kg] ),
                FILTER ( fBudget, YEAR ( fBudget[Date] ) = YEAR ( fOrder[OrderDate] ) )
            )
        )
)

Here is the result.
1-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

@v-eachen-msft : thanks so much for your help and the solution!

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.