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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
sureshcu
Helper I
Helper I

Summarize Table to retrieve 2017 data

Hi,

 

I have created Table using summarize function. however, I want to restrict the data of 2017 only. Can you please help to retrieve only 2017 data. I have written the following measure.

 

HC & Attrition % = SUMMARIZE(Append1,Append1[Reporting Month],"Total HC",[Total EMP],"Total Attrition",[Attrition])Query.jpg

 

1 ACCEPTED SOLUTION

You Rock Zubair. A ton thanks for you. It is working fine

View solution in original post

6 REPLIES 6
Zubair_Muhammad
Community Champion
Community Champion

Hi @sureshcu

 

Wrap it with a filter

 

Try this

 

HC & Attrition % =
FILTER (
    SUMMARIZE (
        Append1,
        Append1[Reporting Month],
        "Total HC", [Total EMP],
        "Total Attrition", [Attrition]
    ),
    YEAR ( Append1[Reporting Month] ) = "2017"
)

Regards
Zubair

Please try my custom visuals

Hi Zubair,

 

I have tried. it is throwing the following error

 

DAX comparison operations do not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.

HI @sureshcu

 

Try this

 

HC & Attrition % =
FILTER (
    SUMMARIZE (
        Append1,
        Append1[Reporting Month],
        "Total HC", [Total EMP],
        "Total Attrition", [Attrition]
    ),
    OR (
        YEAR ( Append1[Reporting Month] ) = 2017,
        AND (
            YEAR ( Append1[Reporting Month] ) = 2016,
            MONTH ( Append1[Reporting Month] ) = 12
        )
    )
)

Regards
Zubair

Please try my custom visuals

You Rock Zubair. A ton thanks for you. It is working fine

Hi @sureshcu

 

Please remove the apostrophies from 2017.

 

Instead of "2017" use 2017 only


Regards
Zubair

Please try my custom visuals

Hi Zubair,

 

Thanks for your help. It is working fine.

 

And one more clarification. is it possible to add December 2016 Month to this table.

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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