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
Anonymous
Not applicable

Finding group maximun in analysis services

Hello world, 
I have this is issue

akampianakis_0-1622015452127.png

as you can see a single invoice number can have multiple statuses. I want to create a measure and filter by it so that if invoice number has 2 statuses, then the final status of the whole invoice number would be validated, in not the leave the status as is. 
I was considering a group calculation with min/max but I couldn't make it working. 
Any ideas?
Thanks in advance

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please check the below picture and the measure.

 

Picture3.png

 

Status Measure =
VAR currentinvoice =
MAX ( 'Table'[AP Invoice Number] )
RETURN
IF (
COUNTROWS (
FILTER ( ALL ( 'Table' ), 'Table'[AP Invoice Number] = currentinvoice )
) > 1
&& "Validated"
IN SUMMARIZE (
FILTER ( ALL ( 'Table' ), 'Table'[AP Invoice Number] = currentinvoice ),
'Table'[AP Invoice Status]
),
"Validated",
SELECTEDVALUE ( 'Table'[AP Invoice Status] )
)

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please check the below picture and the measure.

 

Picture3.png

 

Status Measure =
VAR currentinvoice =
MAX ( 'Table'[AP Invoice Number] )
RETURN
IF (
COUNTROWS (
FILTER ( ALL ( 'Table' ), 'Table'[AP Invoice Number] = currentinvoice )
) > 1
&& "Validated"
IN SUMMARIZE (
FILTER ( ALL ( 'Table' ), 'Table'[AP Invoice Number] = currentinvoice ),
'Table'[AP Invoice Status]
),
"Validated",
SELECTEDVALUE ( 'Table'[AP Invoice Status] )
)

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Fowmy
Super User
Super User

@Anonymous 

Add the following measure:

Final Ivoice Status = 
var __current = MAX(Table4[AP Invoie No]) return
IF(
    CALCULATE(
        COUNTROWS(Table4),
        Table4[AP Invoie No] = __current,
        REMOVEFILTERS(Table4)
    ) = 2,
    "Validated",
    UNICHAR(8302)
)

Fowmy_0-1622016805462.png

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Wish I could also click as solution on this one too cause it works great too!Thanks!

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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