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
SethuPower
Frequent Visitor

Increase Count on Status & Product Change

Hello All,

Product and Status is the columns i have and need data in column Group as output.

Group number to change when the status changes and Product changes

Could you please help with the DAX query

@Ashish_Mathur - I could see you have helped on similar query. Could you please assist on this one

 

ProductStatusGroup
SoapApproved1
SoapApproved1
SoapRemoved2
SoapRemoved2
SoapSales3
SoapRemoved4
SoapOthers5
SoapRemoved6
SoapRemoved6
SoapRemoved6
SoapRemoved6
SoapRemoved6
SoapOthers7
SoapOthers7
SoapOthers7
BoxApproved1
BoxRemoved2
BoxRemoved2
BoxOthers3
BoxSales4
BoxSales4
1 ACCEPTED SOLUTION

@SethuPower 

 

Please see the attached file for steps as well

 


Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Could you share the link of the post where you saw my solution to a similar problem.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

hi Ashish,

 

Thanks for your reply. Unfortuantely couldn't find that post now. Any luck based on the data example?

@SethuPower 

 

Try this

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCs5PLFDSUXIsKCjKL0tNUYrVwSsWlJpLhFBwYk5qMQE1/iUZqUWEFFFTCNNCvCJO+RXoYQARQjYalwiGOYgQQeHHAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Product = _t, Status = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Status", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Product"}, {{"ALL", each _, type table }}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn(
Table.Group([ALL], {"Status","Product"}, {{"ALL", each _, type table }},GroupKind.Local),"Index",1,1)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"ALL"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Status", "ALL", "Index"}, {"Status", "ALL", "Index"}),
    #"Expanded ALL" = Table.ExpandTableColumn(#"Expanded Custom", "ALL", {"Status"}, {"Status.1"})
in
    #"Expanded ALL"

Regards
Zubair

Please try my custom visuals

@SethuPower 

 

Please see the attached file for steps as well

 


Regards
Zubair

Please try my custom visuals

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.

Top Solution Authors