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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Justas4478
Responsive Resident
Responsive Resident

Creating group by measure using existing measure

Hi, I have this measure which count shorted qty and gives number of days item was shorted.

Days Shorted = VAR _Table =
    SUMMARIZE(
         'Outbound Delivery',
         'Product Category'[Level 2],
         'Date'[Date],
         "@Shorted", 'Outbound Delivery'[Shorted Qty]
    )
VAR _Result =
    COUNTX(
        FILTER(
             _Table,
              [@Shorted] <> 0
        ),
        [@Shorted]
    )
RETURN
  _Result 
Problem is that withou further grouping this data is not that usefull.
I would be abel to do it if it were calculated column.
But unfortunatelly for me we are using live connection model, so I can only create measures.
This is sample of the data that I have:
Justas4478_0-1714384321283.png

And I trying to group 'Days Shorted' into six groups. These are the groups:

Justas4478_1-1714384418781.png

And this is expected result based on sample data:

Justas4478_2-1714384505198.png

I attached sample data.
https://we.tl/t-fT2YKclDaE 

If there is need for larger data sample I can provide it.

1 REPLY 1
MFelix
Super User
Super User

Hi @Justas4478 ,

 

since you are in live connection you need to create a measure for each of your calculation try to add a measure for each of your calculations:

 

1 days = 
        VAR temp_table = SUMMARIZE(
			'Outbound Delivery',
			'Outbound Delivery'[Gate/Floor],
			'Outbound Delivery'[SKU Number],
			"Days", [Days Shorted]
		)
		RETURN

			COUNTROWS(FILTER(
				temp_table,
				[Days] = 1
			)

			)

 Just replace the 1 by the number of days you need and then on the matrix visualization put values on rows:

MFelix_0-1714406256533.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.