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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
AllanBerces
Post Prodigy
Post Prodigy

Sum per Week and Filter

Hi and good day,
Can anyone pls need help on my measure.

Measure1 = Sum per Week per Location
Measure2 = Sum per Code per Week per Location

PLS NOTE: Need to Filter  Type = Indirect

AllanBerces_0-1732601796286.png

DESIRED OUTPUT in MEASURE

AllanBerces_1-1732601863566.png

Thank you

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

hi @AllanBerces 

 

Please try these:

Measure1 =
CALCULATE (
    data[hrs],
    ALLEXCEPT ( data, data[week no], data[location] ),
    KEEPFILTERS ( data[filter type] = "indirect" )
)


Measure1 =
CALCULATE (
    data[hrs],
    ALLEXCEPT ( data, data[week no], data[location], data[code] ),
    KEEPFILTERS ( data[filter type] = "indirect" )
)




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
grazitti_sapna
Super User
Super User

Hi @AllanBerces ,
You can Implement the following Dax:

Measure1: Sum per Week per Location

Measure1 = 
CALCULATE(
SUM('Table'[NPHrs]),
'Table'[Type] = "Indirect"
)

Measure2: Sum per Code, Week, and Location

Measure2 = 
CALCULATE(
SUM('Table'[NPHrs]),
'Table'[Type] = "Indirect",
ALLEXCEPT('Table', 'Table'[Code], 'Table'[WeekNo], 'Table'[Location])
)

Explanation:

  • Measure1:
    Sums up NPHrs for rows where Type is "Indirect".
    Groups the result by Location and WeekNo.
  • Measure2:
    Sums up NPHrs for rows where Type is "Indirect".
    Groups the result by Code, Location, and WeekNo.

If I have resolved your question, please consider marking my post as a solution. Thank you!

danextian
Super User
Super User

hi @AllanBerces 

 

Please try these:

Measure1 =
CALCULATE (
    data[hrs],
    ALLEXCEPT ( data, data[week no], data[location] ),
    KEEPFILTERS ( data[filter type] = "indirect" )
)


Measure1 =
CALCULATE (
    data[hrs],
    ALLEXCEPT ( data, data[week no], data[location], data[code] ),
    KEEPFILTERS ( data[filter type] = "indirect" )
)




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian @grazitti_sapna thank you very much for you reply, working perfectly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.