cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Misq
Frequent Visitor

Exclude rows which didnt appear yesterday

Hello, everyone,


I need help with one issue. I have a data model where I calculate events that were 50% more than the previous day and I want to count them (Count).

 

Measure = 

VAR Today = 
    CALCULATE(SUM(Table[Minutes]),Table[Date]=MAXX(Table,Table[Date]))
	
VAR Yesterday = 
    CALCULATE(SUM(Table[minutesX1.2]),Table[Date]=MAXX(Table,Table[Date])-1)
	
RETURN
    SWITCH(TRUE(),
        (Today>Yesterday),1,
0)

 

 

As in the following screenshot, I would like the formula to count my values in row A, E because they have 50% more value than the previous day.

 

Currently, my measure is set so that it counts the values in columns A, B, D, E, because these values in the previous day had the value BLANK and therefore are automatically 50% larger.

 

Do you know any solution how to exclude this so that the values show correctly Count = 2?

 

Table

Misq_0-1646924553931.png

 

 

Matrix

Misq_1-1646922103484.png

Thanks in advance!

1 REPLY 1
v-cgao-msft
Community Support
Community Support

Hi @Misq ,

I don't find column [Minutes] and column [Minutes*1.2] in the expression in the picture, please consider sharing more details about it. And it would be great if there was a sample file without any sensitive information here.

 

It makes it easier to give you a solution.

  1. Sample (dummy dataset) data as text, use the table tool in the editing bar.
  2. Expected output from sample data.
  3. Explanation in words of how to get from 1. to 2.

 

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

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!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.