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
amandabus21
Helper V
Helper V

Sum of a Measure

I have a measure: 

Less than 15 Days (StorLoc) =
IF('Purchase Orders'[Stor Loc Measure] > 0 && 'Purchase Orders'[Stor Loc Measure] < 15, 1, 0)
 
This neasure is working correctly but now I need the Sum of all the values populating. 
 
amandabus21_0-1690410808231.png

 

1 ACCEPTED SOLUTION

You may need a separate measure for this.  First, create your regular measure for Less than 15 days and then create a new measure like the following.

 

SUMX(

    VALUES('Table'[Break-down Column]),

    [Less than 15 Days (StoreLoc)]

)

 

or the multiple columns version:

 

SUMX(

    SUMMARIZECOLUMNS(Column1, Column2, ...),

    [Less than 15 Days (StoreLoc)]

)

 

I hope this work.

 

Julio V.

View solution in original post

6 REPLIES 6
amandabus21
Helper V
Helper V

that worked perfectly! thank you so much for your help! 🙂 

julioverdugo
Frequent Visitor

You need to put your IF statement inside a SUMX like follows:

 

SUMX(

    VALUES('Purchase Orders'[Purchase Order #]),

    IF('Purchase Orders'[Stor Loc Measure] 0 && 'Purchase Orders'[Stor Loc Measure] 15, 1, 0)

)

 

If the previous doesn't work you can create a new measure as follow:

SUMX(

    VALUES('Purchase Orders'[Purchase Order #]),

    [Less than 15 Days (StoreLoc)]

)

 

I hope this helps. 

 

Best,

 

Julio V.

Hi,

 

That worked, however my grand totals are a little bit off.


For example = 14 + 13+ 9 = 36 

 

in the matrix it says total = 34

 

amandabus21_0-1690474415003.png

 

Hi,

 

You need to put inside the values the column you are using to break down your data. If you need to break down with multiple columns you can use the SUMMARIZECOLUMN function instead. In the scenario you shared it would be:

 

SUMX(

    VALUES('Purchase Orders'[Loc]),

    IF('Purchase Orders'[Stor Loc Measure] 0 && 'Purchase Orders'[Stor Loc Measure] 15, 1, 0)

)

 

Let me know if this works.

 

Julio V.

Where would I add in the summarize columns. 

 

I tried your last formula but it just returned 0.

 

This is the stor loc measure for context:

Stor Loc Measure =

SUMX(
    VALUES('Purchase Orders'[Purchase Order #.Purchase Order # Level 01]),
    DATEDIFF(
        CALCULATE(MAX('Purchase Orders'[Delivery Date.Delivery Date Level 01])),
        TODAY(),
        DAY
    )
)



You may need a separate measure for this.  First, create your regular measure for Less than 15 days and then create a new measure like the following.

 

SUMX(

    VALUES('Table'[Break-down Column]),

    [Less than 15 Days (StoreLoc)]

)

 

or the multiple columns version:

 

SUMX(

    SUMMARIZECOLUMNS(Column1, Column2, ...),

    [Less than 15 Days (StoreLoc)]

)

 

I hope this work.

 

Julio V.

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.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.