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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
paulfink
Post Patron
Post Patron

Spread total over rows

Hi guys, 

 

I need have a measure that takes the value depending on the progress of a task.

 

I need to take them totals and spread it across a project.

ProjectTaskValueDESIRED
1A1045
1B1545
1C2045
2A530
2B1030
2C1530

 

This is what i need based on my current table.

 

I have this measure which works:

 

 

Change Val Total = CALCULATE(SUM('Table1'[Value]), ALLEXCEPT('Table1', 'Table1'[Project], 'Table1'[Date]))

 

 

but the value needs to be a measure, as it is bringing back errors on other formulas.
 
I have my measure ready (Value1) i just dont know how to do the spread out formula.
 
How could i do this
 
 
1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @paulfink 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

a3.png

 

Value(Measure):

Value = 
var _pro = SELECTEDVALUE('Table'[Project])
var _task = SELECTEDVALUE('Table'[Task])
return
SWITCH(
    _pro,
    1,
    SWITCH(
        _task,
        "A",10,
        "B",15,
        "C",20
    ),
    2,
    SWITCH(
        _task,
        "A",5,
        "B",10,
        "C",15
    )
)

 

You may create a measure like below.

Desired = 
var tab = 
SUMMARIZE(
    ALL('Table'),
    'Table'[Project],
    'Table'[Task],
    "Value",
    var _pro = 'Table'[Project]
    var _task = 'Table'[Task]
    return
    SWITCH(
        _pro,
        1,
        SWITCH(
            _task,
            "A",10,
            "B",15,
            "C",20
        ),
        2,
        SWITCH(
            _task,
            "A",5,
            "B",10,
            "C",15
        )
    )
)
return
SUMX(
    FILTER(
        tab,
        [Project]=SELECTEDVALUE('Table'[Project])
    ),
    [Value]
)

 

Result:

a4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
v-alq-msft
Community Support
Community Support

Hi, @paulfink 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

a3.png

 

Value(Measure):

Value = 
var _pro = SELECTEDVALUE('Table'[Project])
var _task = SELECTEDVALUE('Table'[Task])
return
SWITCH(
    _pro,
    1,
    SWITCH(
        _task,
        "A",10,
        "B",15,
        "C",20
    ),
    2,
    SWITCH(
        _task,
        "A",5,
        "B",10,
        "C",15
    )
)

 

You may create a measure like below.

Desired = 
var tab = 
SUMMARIZE(
    ALL('Table'),
    'Table'[Project],
    'Table'[Task],
    "Value",
    var _pro = 'Table'[Project]
    var _task = 'Table'[Task]
    return
    SWITCH(
        _pro,
        1,
        SWITCH(
            _task,
            "A",10,
            "B",15,
            "C",20
        ),
        2,
        SWITCH(
            _task,
            "A",5,
            "B",10,
            "C",15
        )
    )
)
return
SUMX(
    FILTER(
        tab,
        [Project]=SELECTEDVALUE('Table'[Project])
    ),
    [Value]
)

 

Result:

a4.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@paulfink , where is date,

It should be like

 

Sub Total = CALCULATE(SUM('Table1'[Value]), ALLEXCEPT('Table1', 'Table1'[Project]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak I have already tried that and it does not work.

 

I need the value to be a measure so please reference it as Value1.

 

 

@paulfink ,

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak there is already an example in my post

@paulfink , That is an image. Not the fastest way. I need to create data myself?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak have you managed to find a solution?

updated

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors