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

A measure based on conditions that I can't do due to lack of experience

Hey there, 
I've been struggling with this problem for a week now, I am relatively new to DAX and have never worked with time series in it.

Pre-requisites (tables):

1) with the Project name and the date when the dashboard was created for it

PreacherBaby_0-1665736794186.png

2) The Project name (it has parts, like physical parts, and details), part # (part's name), and the date when the part was added

PreacherBaby_2-1665736933713.png

What do I want from the measure (there are many projects, but as an example, let's pick project 976)

- As you can see in the tables above, project 976 has a dashboard created in the month of August (8/18/2022)

- And it also has parts that were added both in the same month and a long time ago (before August, for the sake of simplicity)

 

Conditions

1) If the project has AT LEAST ONE part added in the month OR before its dashboard has been created - the project meets the criteria to be displayed. 

  • Example: project 976's dashboard was activated in the month of August, and it has AT LEAST one part that was added in/before August. That is why 976 meets the criteria to be displayed in the stacked bar chart for August and its upcoming months: September, October, and so on.

2)  If the project doesn't have AT LEAST ONE part added in the month OR before its dashboard has been created - the project does not meet the criteria to be displayed. 

  • Example: Imagine project 976's dashboard was activated in the month of August, but there isn't a single part that was added in/before August. 976 does not meet the criteria to be displayed in the stacked bar chart for August and its upcoming months: September, October, and so on.

3) If the project does have AT LEAST ONE part added, BUT it happened AFTER the dashboard has been created - the project should be displayed in the month when both criteria have been met.

  • Example: Imagine project 976's dashboard was activated in the month of August, but it had AT LEAST one part added in September - project 976 should not be displayed in August, but it should be displayed for September and upcoming months.

4) Same rules apply when the project has AT LEAST ONE part in, for example, August, but the dashboard was activated in September: it means that the project should not be displayed in August, but to be displayed starting from September. 


This measure will work as a filter for the stacked bar chart which is the count of the projects

PreacherBaby_3-1665737524003.png

 

1 REPLY 1
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors