cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Hifni93
Regular Visitor

two different Dates count in one dashboard

hello Community 
i have my table withe the following columns Assetnum(identity),claasification, Arrival date(year) , Decomissioning date(year) 
what i am trying to do is to have the count of dates in one dashboard that have the year in axis thus for example for the years after 2016 i want to know the count of arrival date and the count of decomissioning date to do so i had to create another table that have the years from 2016 and on, and duplicate my table and i joined the year table to my original table and the duplicate table and i got the desired results , my problem now is that i have to filter the dashboard using the classification column wish results on filtering just one of the two dates is there anyway to do it ?  or another way to achieve the same result ?
here is my dashboard 

Hifni93_0-1687425190661.png

and here is my model 

Hifni93_1-1687425266022.png

2 ACCEPTED SOLUTIONS
rbriga
Impactful Individual
Impactful Individual

Have a single calendar table with each date a unique value.

Create two relationships between your fact table and your calendar table:

  1. Calendar[Date] ---> Fact[Arrival Date] (one to many)
  2. Calendar[Date] ---> Fact[Decomissioning Date] (one to many) Inactive

Then you can have two measure to display on the same chart:

Rows (Arrival) = COUNTROWS('Fact Table Name')

And

Rows (Decommission) = Calculate(COUNTROWS('Fact Table Name'), USERELATIONSHIP('Calendar'[Date],'Fact Table Name'[Decommission Date]))

This should do it- you switch the relationship within the DAX measure, without a duplicate calendar table.

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

View solution in original post

rbriga
Impactful Individual
Impactful Individual

Note that this is a stacked area chart. This is the expected behavior.

Either:

1. Change into a (non-stacked) area chart 

Area Chart.png

or 2. Switch the order of the measures in the visualization pane:

Legend Order 1.png

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

View solution in original post

5 REPLIES 5
Hifni93
Regular Visitor

@rbriga taking a small look into my graph i noticed a small problem taking a look at the year 2016 the count with the small amount (886) is above the hiegher count (1803) looking at the Y axis this should be the other way is there anyway to fix this ?

Hifni93_0-1688721437098.png

thanks

rbriga
Impactful Individual
Impactful Individual

Note that this is a stacked area chart. This is the expected behavior.

Either:

1. Change into a (non-stacked) area chart 

Area Chart.png

or 2. Switch the order of the measures in the visualization pane:

Legend Order 1.png

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

well thanks that worked just fine 

rbriga
Impactful Individual
Impactful Individual

Have a single calendar table with each date a unique value.

Create two relationships between your fact table and your calendar table:

  1. Calendar[Date] ---> Fact[Arrival Date] (one to many)
  2. Calendar[Date] ---> Fact[Decomissioning Date] (one to many) Inactive

Then you can have two measure to display on the same chart:

Rows (Arrival) = COUNTROWS('Fact Table Name')

And

Rows (Decommission) = Calculate(COUNTROWS('Fact Table Name'), USERELATIONSHIP('Calendar'[Date],'Fact Table Name'[Decommission Date]))

This should do it- you switch the relationship within the DAX measure, without a duplicate calendar table.

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

thanks that worked just fine !!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors