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
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
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.