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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
afiqhaziq
Frequent Visitor

Take latest data from share point for Card Visualization

Hi,

 

I have the data card as below that display efficiency for each section.

afiqhaziq_1-1704702552381.png

 

My sharepoint list as below

 

afiqhaziq_2-1704702631173.png

Currently,  I have duplicate error because in the SP list have multiple date with same section. 

 

What i need is only for the data card to show the latest data for each section. Anyone has suggestion. 

 

Thank you

 

P/S : I update data multiple times per day

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @afiqhaziq 

You can put the following code to advanced editor in power query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fZDLCsIwEEV/JWRd7MzkOdnVuitFEHel//8bxjyaRlEIhyzumbnJtkk/4khAWugAEM+0ykGSokSMhAuzcfGyPMQ6yX3oHM0BvMiSgSRBlt4Tbvd5EfjpGAgI2THJMdqURcDVomRxtjBaimK7bpP2xSLo6nFbpdRJsol1lcWfkj0kRN9Y8tevvDvyzlf8nt7SiitK+jn/SVtbgf3XnuO+VQffWAXVCxyozdcm1SGbPsghUHvw/gI=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, CurrentPlan = _t, CurrentActual = _t, #"Operation Rate" = _t, Section = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type datetime}, {"CurrentPlan", Int64.Type}, {"CurrentActual", Int64.Type}, {"Operation Rate", Percentage.Type}, {"Section", type text}}),
    #"Changed Type with Locale" = Table.TransformColumnTypes(#"Changed Type", {{"Date", type datetime}}, "en-GB"),
    #"Added Custom" = Table.AddColumn(#"Changed Type with Locale", "Custom", each List.Max(Table.SelectRows(#"Changed Type with Locale", (x)=>x[Section]=[Section])[Date])),
    #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Date] = [Custom])),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Custom"})
in
    #"Removed Columns"

Output

vxinruzhumsft_0-1704856233960.png

It only displayed the latest data of each section.

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

View solution in original post

Thanks. Need few editing and works like magic

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @afiqhaziq 

You can refer to the following measure.

Measure =
VAR _filter =
    FILTER ( ALLSELECTED ( 'Table' ), [Shift] IN VALUES ( 'Table'[Shift] ) )
VAR _maxdate =
    CALCULATE ( MAX ( 'Table'[Date] ), _filter )
RETURN
    MAXX ( FILTER ( _filter, [Date] = _maxdate ), [Operation Rate] )

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

How to apply this to the power query though. Sorry, I dont have knowledge on DAX yet

 

afiqhaziq_0-1704793274035.png

 

Anonymous
Not applicable

Hi @afiqhaziq 

You can put the following code to advanced editor in power query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fZDLCsIwEEV/JWRd7MzkOdnVuitFEHel//8bxjyaRlEIhyzumbnJtkk/4khAWugAEM+0ykGSokSMhAuzcfGyPMQ6yX3oHM0BvMiSgSRBlt4Tbvd5EfjpGAgI2THJMdqURcDVomRxtjBaimK7bpP2xSLo6nFbpdRJsol1lcWfkj0kRN9Y8tevvDvyzlf8nt7SiitK+jn/SVtbgf3XnuO+VQffWAXVCxyozdcm1SGbPsghUHvw/gI=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, CurrentPlan = _t, CurrentActual = _t, #"Operation Rate" = _t, Section = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type datetime}, {"CurrentPlan", Int64.Type}, {"CurrentActual", Int64.Type}, {"Operation Rate", Percentage.Type}, {"Section", type text}}),
    #"Changed Type with Locale" = Table.TransformColumnTypes(#"Changed Type", {{"Date", type datetime}}, "en-GB"),
    #"Added Custom" = Table.AddColumn(#"Changed Type with Locale", "Custom", each List.Max(Table.SelectRows(#"Changed Type with Locale", (x)=>x[Section]=[Section])[Date])),
    #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([Date] = [Custom])),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Custom"})
in
    #"Removed Columns"

Output

vxinruzhumsft_0-1704856233960.png

It only displayed the latest data of each section.

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

Thanks. Need few editing and works like magic

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors