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

Visualize event that never happened vs. one that happened with Date data

Please imagine a simple table with the following data:

 

Customer
Last Purchased
Item
Ron
31/12/2021
Chocolates
Marie
Never (or 0)
-
Sam
12.08/2009
Apples

 

I want to visualize the customers who purchased most recenly and who never purchased in a singe visulization (never purchased is a negative aspect and that needs to be highlighted) - how can this be done?

 

One of my ideas was to put a very old date instead of never and use a bar graph, however, the idea seems, odd! 

 

Any ideas? Thanks!

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

How about:

1) Add a date column to your table formatted as a date:

table.JPG

 2) create a measure to return the last purchase date by customer (or Never):

Last Purchased =
IF (
    MAX ( 'Table'[Date] ) = "Never",
    "Never",
    CALCULATE ( MAX ( 'Table'[Dates] ), ALLEXCEPT ( 'Table', 'Table'[Customer] ) )
)

3) Create a measure to use for conditional formatting:

Condit Formatting Never = IF(MAX('Table'[Date]) = "Never", 1)

 

Create a table visual with the customer field and the Last Purchased measure. Use the [condit formatting never] measure to format the fields in the table:

result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

6 REPLIES 6
PaulDBrown
Community Champion
Community Champion

How about:

1) Add a date column to your table formatted as a date:

table.JPG

 2) create a measure to return the last purchase date by customer (or Never):

Last Purchased =
IF (
    MAX ( 'Table'[Date] ) = "Never",
    "Never",
    CALCULATE ( MAX ( 'Table'[Dates] ), ALLEXCEPT ( 'Table', 'Table'[Customer] ) )
)

3) Create a measure to use for conditional formatting:

Condit Formatting Never = IF(MAX('Table'[Date]) = "Never", 1)

 

Create a table visual with the customer field and the Last Purchased measure. Use the [condit formatting never] measure to format the fields in the table:

result.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






AkshataRevankar
Frequent Visitor

Is this what you are looking for?

A DAX fucntion which converts NULL to 0 should work.

AkshataRevankar_1-1623166084854.png

 

 

Anonymous
Not applicable

hello, thanks for your reply. Not exacty, I am not asking if I can convert Never to 0 etc., I can do it in the backend. I am rather looking for the best way to visualize, i.e. to show/highlight it to stakeholders when a date is missing (never, 0 whatever). 

A table visual seems to bring up rows with no/null date and group the data based on date granularity.

AkshataRevankar_0-1623167852426.png

 

PaulDBrown
Community Champion
Community Champion

Can you share some sample data ?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Sample Data Please note that customers can repeat. 

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.