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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
DCampbellTSS
New Member

Assistance with distribution in formula

I am currently working on a formula that was given to me for weighing items based on a designated Option. I have it working but only for the initial quarter, it doesn't distribute out to the rest of the quarters in the year. I am currenly only getting the Project Start Date and End date, I used the Start Date but recognized my error when the other quarters weren't reporting any data. Does anyone have any ideas on an approach to distribute based on quarters even though I only have a start and end date? 

 

Schedule Weight = SWITCH(TRUE(),
[cost_budget_properties.value] = "Option 1",
IF([admin_projects.start_date] = 1, 0.25 * [cost_budgets.quantity],
IF([admin_projects.start_date] = 2, 0.25 * [cost_budgets.quantity],
IF([admin_projects.start_date] = 3, 0.25 * [cost_budgets.quantity],
IF([admin_projects.start_date] = 4, 0.25 * [cost_budgets.quantity], 0)))),
[cost_budget_properties.value] = "Option 2",
IF([admin_projects.start_date] = 1, 0.50 * [cost_budgets.quantity],
IF([admin_projects.start_date] = 2, 0.10 * [cost_budgets.quantity],
IF([admin_projects.start_date] = 3, 0.10 * [cost_budgets.quantity],
IF([admin_projects.start_date] = 4, 0.30 * [cost_budgets.quantity], 0)))),
[cost_budget_properties.value] = "Option 3",
IF([admin_projects.start_date] = 1, 0.75 * [cost_budgets.quantity],
IF([admin_projects.start_date] = 2, 0,
IF([admin_projects.start_date] = 3, 0,
IF([admin_projects.start_date] = 4, 0.25 * [cost_budgets.quantity], 0)))),
0
)
1 REPLY 1
Fowmy
Super User
Super User

@DCampbellTSS 

Please try this modifed version where both start and end dates are considered:

Schedule Weight = 
VAR StartQtr = QUARTER([admin_projects.start_date])
VAR EndQtr = QUARTER([admin_projects.end_date])
VAR TotalQuarters = EndQtr - StartQtr + 1
VAR CurrentQtr = SELECTEDVALUE('Calendar'[Quarter])

RETURN
IF(
    StartQtr <= CurrentQtr && CurrentQtr <= EndQtr, 
    SWITCH(
        TRUE(),
        [cost_budget_properties.value] = "Option 1", 
            (1 / TotalQuarters) * [cost_budgets.quantity],
        
        [cost_budget_properties.value] = "Option 2",
            LOOKUPVALUE(Option2Weights[Weight], Option2Weights[Quarter], CurrentQtr) * [cost_budgets.quantity],
        
        [cost_budget_properties.value] = "Option 3",
            LOOKUPVALUE(Option3Weights[Weight], Option3Weights[Quarter], CurrentQtr) * [cost_budgets.quantity],
        
        0
    ),
    0
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.