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
hamadani
Frequent Visitor

Shared X axis for multiple dates and Count of occurrence on Y axis

Hi,

I have a table similar to below

Case ID      Deadline 1       Deadline 2    Deadline 3    Deadline 4     
ADec 2022Feb 2023May 2023Jun 2024
B Jul 2020May 2023Aug 2024
CMay 2019Jul 2020Dec 2021 
DJul 2020Mar 2021Apr 2021Aug 2024
EMay 2019 May 2023Aug 2024
FDec 2022Feb 2023May 2023Aug 2024
GDec 2022Feb 2023May 2023Aug 2024

 

I would like to have a graph with single x axis as date (from min(date) of above table to max(date)) and then number of cases who have a deadline for a given date.  So, I am expecting something similar to below:

hamadani_1-1668078588945.png

 

Thanks

 

1 ACCEPTED SOLUTION
v-yadongf-msft
Community Support
Community Support

Hi @hamadani ,

 

This is my test table:

vyadongfmsft_0-1668413758842.png

 

Select "Case ID" and Unpivot other columns:

vyadongfmsft_1-1668413869590.png

 

You will get a table like this:

vyadongfmsft_2-1668413903659.png

 

Close and apply to Power BI, create a measure:

 

Count of case =
CALCULATE (
    COUNT ( 'Table'[Case ID] ),
    FILTER ( 'Table', 'Table'[Value] = SELECTEDVALUE ( 'Table'[Value] ) )
)

 

 

Create a scatter visual:

vyadongfmsft_3-1668414148191.png

 

I think this is the result you want.

 

Best regards,

Yadong Fang

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

View solution in original post

3 REPLIES 3
v-yadongf-msft
Community Support
Community Support

Hi @hamadani ,

 

This is my test table:

vyadongfmsft_0-1668413758842.png

 

Select "Case ID" and Unpivot other columns:

vyadongfmsft_1-1668413869590.png

 

You will get a table like this:

vyadongfmsft_2-1668413903659.png

 

Close and apply to Power BI, create a measure:

 

Count of case =
CALCULATE (
    COUNT ( 'Table'[Case ID] ),
    FILTER ( 'Table', 'Table'[Value] = SELECTEDVALUE ( 'Table'[Value] ) )
)

 

 

Create a scatter visual:

vyadongfmsft_3-1668414148191.png

 

I think this is the result you want.

 

Best regards,

Yadong Fang

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

hamadani
Frequent Visitor

Thank you @amitchandak . However, could you please elaborate on what you mean by "joining all of them"? All data is stored in one table 

amitchandak
Super User
Super User

@hamadani , Join all of them with a common date table and use date from date table on axis.

 

Other than one join all other joins will be inactive, use userelationship for that

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

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.