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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Oguzhan0556
Helper I
Helper I

RANKX & CARD

Hello,

 

I have a dataset named "CollectionData". I will introduce you the columns in the table and the first 5 rows in these columns.

 

DateEkipNameCollectionSourceGroupCollectionTRYCurrentUPB
01.06.2020InboundProtocol23423444354
10.10.2021OutboundDiger343244534
17.03.2022DigerExecution Office3423454
20.05.2022DigerSalary Attachment345454

 

Toplam Tahsilat = SUM(CollectionData[CollectionTRY])

Toplam Anapara = SUM(CollectionData[CurrentUPB])

 

What I want to do is I split the "Toplam Tahsilat" and "Toplam Anapara" fields into each other. I sorted them by "EkipName" and "CollectionSourceName" columns, from largest to smallest. No problems so far. I am sharing the Measure below.

 

SIRALAMA =

IF(
OR(
HASONEFILTER(CollectionData[EkipName]),
HASONEFILTER(CollectionData[CollectionSourceGroup])
),
RANKX(
ALL(CollectionData[EkipName],CollectionData[CollectionSourceGroup]),
DIVIDE([Toplam Tahsilat], [Toplam Anapara], 0)
)
)

Screenshot_3.png

 

It should not be forgotten that there was also a "Date" field in Raw Data, but I removed the "Date" field in the table. So I changed the Context and sorted accordingly.

 

But what I want to do is I want to show the value of "EkipName" as "Card" of the row with the largest order. I wrote the following DAX for this, but it doesn't work. Because the Context is different.

 

ForCard =
IF (
    [SIRALAMA] = 1,
    MAXX ( FILTER ( CollectionData , [SIRALAMA] = 1 ), CollectionData[EkipName] )
)

 

Can anyone help? Thanks.

 

 

5 REPLIES 5
ERD
Super User
Super User

@Oguzhan0556 , you only need this part:

ForCard = 
MAXX ( FILTER ( CollectionData , [SIRALAMA] = 1 ), CollectionData[EkipName] )

ERD_0-1691088207237.png

 

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Unfortunately it does not give the correct value. Can you share your e-mail address if it is suitable for you? Shall I send the PBI file? If you can send it here, I can send it here too.

 

Oguzhan0556_0-1691170831749.png

 

 

 

Oguzhan0556
Helper I
Helper I

Hello,

Thanks for the answer. I seem to remember that I tried this code, but I wasn't sure. I'll check it tonight and post my answer. Thanks again.

johnt75
Super User
Super User

You need to remove the IF statement as that will never be true

For Card =
CONCATENATEX (
    FILTER ( CollectionData, [SIRALAMA] = 1 ),
    CollectionData[EkipName],
    ","
)

I tried it and got the following result 🙂 The value that should appear on the card should be "Outbound".

 

Oguzhan0556_0-1691082053918.png

 

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.