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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Need help with a calculated column

Hi,

I am looking to group two columns and find the sum of result, as given in the table below.

I hope we can use Summarize() to acheive this , but  that would create a new table and I dont want the result as a new table.  I want to have this column with in the same table as a calculated column, Thanks in advance for your help!

 

DateIDValueExpected result
23/11/2017A21vc02
23/11/2017B3gav1
23/11/2017J6gfb1
23/11/2017G56120
24/112017A21vc12
24/112017B3gav0
24/112017J6gfb1
25/11/2017A21vc02
25/11/2017B3gav0
25/11/2017J6gfb1
25/11/2017G56121

 

Regards,

 

2 ACCEPTED SOLUTIONS

HI @Anonymous

 

See the attached PBIX file

 

I just changed

 

(sum('Fact Vacancy_Indvi'[Addition]))

 

to

 

(sum('Fact Vacancy_Indvi'[Mes]))

 

 


Regards
Zubair

Please try my custom visuals

View solution in original post

7 REPLIES 7
Zubair_Muhammad
Community Champion
Community Champion

Hi @Anonymous

 

See if this helps.

 

Do you want the resulting sum only against the first item of that date?

 

=
VAR Firstitem =
    FIRSTNONBLANK (
        CALCULATETABLE (
            VALUES ( Table1[ID] ),
            FILTER ( ALL ( Table1 ), Table1[Date] = EARLIER ( Table1[Date] ) )
        ),
        Table1[ID]
    )
RETURN
    IF (
        Table1[ID] = Firstitem,
        CALCULATE ( SUM ( Table1[Value] ), ALLEXCEPT ( Table1, Table1[Date] ) ),
        BLANK ()
    )

 


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Thanks Zubair,

I have tried your formula, but I get an empty column, below is my screeen shot.

Kindly let me know if you need any more info

 

column =
VAR Firstitem =
FIRSTNONBLANK (
CALCULATETABLE (
VALUES ( 'Fact Vacancy_Indvi'[Did] ),
FILTER ( ALL ( 'Fact Vacancy_Indvi' ), 'Fact Vacancy_Indvi'[Date] = EARLIER ( 'Fact Vacancy_Indvi'[Date] ) )
),
'Fact Vacancy_Indvi'[Did]
)
RETURN
IF (
'Fact Vacancy_Indvi'[Did] = Firstitem,
CALCULATE ( (sum('Fact Vacancy_Indvi'[Addition])) , ALLEXCEPT ( 'Fact Vacancy_Indvi', 'Fact Vacancy_Indvi'[Date] ) ),
BLANK ()
)

 

 

Pic 1.PNG

 

Thanks,

 

Hi @Anonymous

 

It worked with the first sample you provied Smiley Sad

 

See the attached file

 

Could you share the file?

 


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Hi Zubair_Muhammad ,

Below is the link for the sample dataset , kindly let me know if you need anything else

 

https://drive.google.com/open?id=148r_DPdsPz9aZACA4CcFr70MnpD5VUvl

 

Thanks,

 

HI @Anonymous

 

See the attached PBIX file

 

I just changed

 

(sum('Fact Vacancy_Indvi'[Addition]))

 

to

 

(sum('Fact Vacancy_Indvi'[Mes]))

 

 


Regards
Zubair

Please try my custom visuals

60.png


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Thanks Zubair_Muhammad , that worked:)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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