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
Hyperchef1969
Helper V
Helper V

TOTALYTD BASED ON MULTIPLE FILTERS

Hi,

 

I have the following YTD calculations:

 

YTD_inbound_lines_in_time = TOTALYTD(COUNT(Purchasing_data[OTD 0d]),Date_table[Date],Purchasing_data[OTD 0d]="On Time")
YTD_inbound_lines_early = TOTALYTD(COUNT(Purchasing_data[OTD 0d]),Date_table[Date],Purchasing_data[OTD 0d]="Early")
 
Now I want to combine "on time" and "early" in one TOTALYTD calculation called YTD_inbound_lines_in_time_and_early. This means that the inbound lines on time and early are added to one number.
 
I tried with && within the filter, but that does not work.
 
Does anyone has a solution?
1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Hyperchef1969

 

Can you not add the two measures you have?

Have you tried with || , since you want both:

 

YTD_inbound_lines_in_time_OR_early =
TOTALYTD (
    COUNT ( Purchasing_data[OTD 0d] ),
    Date_table[Date],
    Purchasing_data[OTD 0d] IN { "On Time", "Early" }
)

But this measure should provide the same result as adding the two you already have. Each item can be either "On Time" or "Early", right?

View solution in original post

2 REPLIES 2
v-jiascu-msft
Employee
Employee

Hi @Hyperchef1969,

 

Could you please mark the proper answers as solutions?

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AlB
Super User
Super User

Hi @Hyperchef1969

 

Can you not add the two measures you have?

Have you tried with || , since you want both:

 

YTD_inbound_lines_in_time_OR_early =
TOTALYTD (
    COUNT ( Purchasing_data[OTD 0d] ),
    Date_table[Date],
    Purchasing_data[OTD 0d] IN { "On Time", "Early" }
)

But this measure should provide the same result as adding the two you already have. Each item can be either "On Time" or "Early", right?

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.