cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Naveen_SV
Helper III
Helper III

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 logoDACertAzCert

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!






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
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through June10th!

Power BI Dev Camp Session 22 without aka link and time 768x460.jpg

Check it Out!

Watch Session 22 Ted's Dev Camp along with past sessions!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!

Top Kudoed Authors