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
Naveen_SV
Helper IV
Helper IV

How to show Blank value if we have not selected any filters

Hi ,

 

I am looking for card value which should show blank value when i have not selected any filters.

if i have multi values in it card how to display max value of that value

 

below formuale i have tried it's working for date value which has unique.

 

new Check 1 = var total = CALCULATE(COUNT(Table[Date]), ALL(Table[Date])) RETURN IF(HASONEVALUE(Table[Date]), SELECTEDVALUE(Table[Date]), BLANK())

 

this formulae is not working when we have multi vaues below is an example both are from same country but i  would like to display first value of of Name.

ex:

Name  Country

Jack          Brazil

Mack        brazil

 

another ex:

Date  Country

22/02/2020 India

24/10/2020 Brazil

 

ex: datepcd.PNG

1 ACCEPTED SOLUTION

Hi,

 

Please try this:

 

related country =
CALCULATE (
    MAX ( 'Table (2)'[Country] ),
    FILTER ( ALL ( 'Table (2)' ), 'Table (2)'[Date] = MAX ( 'Table (2)'[Date] ) )
)

 

The result shows:

8.PNG

See my attached pbix file.

 

Best Regards,

Giotto

View solution in original post

6 REPLIES 6
v-gizhi-msft
Community Support
Community Support

Hi,

 

I add some data to your original sample to test.

Please try this measure:

new Check 2 = 
IF (
    CALCULATE ( DISTINCTCOUNT ( 'Table (2)'[Date] ), ALLSELECTED ( 'Table (2)' ) )
        = CALCULATE ( DISTINCTCOUNT ( 'Table (2)'[Date] ), ALL ( 'Table (2)' ) ),
    BLANK (),
    MAX ( 'Table (2)'[Date] )
)

When selecting multi values in slicer, compare original measure and this new meaure, it shows:

3.PNG

See my attached pbix file.

 

Best Regards,

Giotto

Hi @v-gizhi-msft 

 

Thanks for your reply if i want to show the country as well in a card related to that date which is max value of the country

how can we show it.

Hi,

 

Please try this:

 

related country =
CALCULATE (
    MAX ( 'Table (2)'[Country] ),
    FILTER ( ALL ( 'Table (2)' ), 'Table (2)'[Date] = MAX ( 'Table (2)'[Date] ) )
)

 

The result shows:

8.PNG

See my attached pbix file.

 

Best Regards,

Giotto

Pragati11
Super User
Super User

Hi @Naveen_SV ,

 

Did you try this DAX as posted in one of your other threads where you asked this as an additional question:?

 

new Check 1 = var total = CALCULATE(COUNT(Table[Date]), ALL(Table[Country])) RETURN IF(HASONEVALUE(Table[Date]), SELECTEDVALUE(Table[Date]), IF(COUNT(Table[Date]) > 1 && COUNT(Table[Date]) < total, MAX(Table[Date]), BLANK()))

 

Just a suggestion, try to understand the above DAX so that you can modify it on your own.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi @Pragati11 ,

 

Thanks for the reply i tried your previous sceniour that i have already updted in this message, where i was not able to get right data when there is no unique data,

however i tried with your new one even though it's was not working some filtered scenario .

 

thanks for your reply 🙂

@Naveen_SV it should be pretty straight forward:

 

Max Date = IF ( ISFILTERED ( YourTable[YourColumnForSlicer] ), MAX ( YourTable[Date] ) ) 

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.