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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
carlenb
Advocate II
Advocate II

How to get the relative value? Model attached

Hi,

 

I'm trying to wrap my head around this. I've attached the model here: https://drive.google.com/file/d/1yIC3LKIDAaCzr5LbQyg5k6w2p4poSNB3/view?usp=sharing 

Also see screenshot of the model below and the expected end result. 

 

carlenb_0-1696406644968.png

carlenb_2-1696407183662.png

 

The expected result is a bar chart where you can filter on project, supplier name and date. The Y-axis will be sales for the total number of projects and the X-axis will be dates based on project starts. Example: the value of project id 1 is 10 700, and the value of the project start in 2024-05-08 is 3 * 10 700 = 32 100. So:

 

  • The Sales table will calculate the volume per project by multiplying Sales[Price] and Sales[Quantity]
  • The additional step is that the measure must also multiply the volume from Sales with the Number of starts in the DimProjectPlan table. Meaning: the volume for Sales is only for one (1) project start, but the correct sum would be Sales[Price] * Sales[Quantity] * DimProjectPlan[Number of starts] as the same project may be sold more than one time. This is the Y-axis. 
  • The X-axis in the chart will be the date from DimProjectPlan[Date] as this shows when each project starts

Data

  • Sales contain price, quantity, project id, project, sub-project, suppliers. Duplicates
  • DimProject is a list of project id, project, sub-project. No duplicates
  • DimProjectPlan is a list of project id, project, sub-project, number of projects, start date. Duplicates 
  • DimSupplier is a unique list of suppliers. No duplicates 
  • Calendar

Thanks for any help

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @carlenb 
Please refr to attached

1.png

Sales Volumne = 
SUMX ( 
    VALUES ( DimProject[ID] ),
    SUMX ( 
        CALCULATETABLE ( Sales ),
        Sales[Quantity] * Sales[Price]
    )
        * CALCULATE ( MAX ( DimProjectPlan[Number of starts] ) )
)

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @carlenb 
Please refr to attached

1.png

Sales Volumne = 
SUMX ( 
    VALUES ( DimProject[ID] ),
    SUMX ( 
        CALCULATETABLE ( Sales ),
        Sales[Quantity] * Sales[Price]
    )
        * CALCULATE ( MAX ( DimProjectPlan[Number of starts] ) )
)

Many thanks @tamerj1 - I got it to work as expected 🙂 thanks for submitting the solution as well! 

carlenb
Advocate II
Advocate II

Added the following example in the thread start: 

 

The value of project id 1 is 10 700, and the value of the project start in 2024-05-08 is 3 * 10 700 = 32 100.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.