Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Microsoft Employee
Microsoft 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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors