Count measure( row context) with condition from another measure ( row context)

  1. This is my difference between two days
    DIFF_INC_TOD =
    VAR todayDt = TODAY()
    VAR incDt = CALCULATE(MAX(FACT_INCIDENT[OP_DATE]), ALLEXCEPT(FACT_INCIDENT, FACT_INCIDENT[OP_DATE]))

RETURN
DATEDIFF(incDt, todayDt, DAY)

  1. This is my bands for measure above
    DIFF_BAND =
    IF([DIFF_INC_TOD]==0, “0 days”,
    IF([DIFF_INC_TOD]<4, “1-3 days”,
    “4+ days”
    )
    )

I need to create table : ( figures inside are wrong, because my measures are wrong )
image

My measures:

Incidents not"0 days" =
CALCULATE(
COUNTROWS(FACT_INCIDENT),(FILTER(’@Dynamic’,’@Dynamic’[DIFF_BAND]=“0 days”)))

Incidents not"1-3 days" =
CALCULATE(
COUNTROWS(FACT_INCIDENT),(FILTER(’@Dynamic’,’@Dynamic’[DIFF_BAND]=“1-3 days”)))

Incidents not"4+ days" =
CALCULATE(
COUNTROWS(FACT_INCIDENT),(FILTER(’@Dynamic’,’@Dynamic’[DIFF_BAND]=“4+ days”)))

(’@Dynamic’ is a table with measures only.)

I need to add that my data is coming from Data Warehouse and I am unable to creates columns( filter context), because I have to use DIRECT Query Connection and this dataset is just huge. Would anyone can help me to figure it out, please . Thanks in advance for all support - Iwona

Hi @Iwona, welcome back to the forum :slight_smile:

I noticed you didn’t provide a PBIX file. Providing one will help users and experts find a solution to your inquiry faster and better.

Check out this thread on Tools and Techniques for Providing PBIX Files with Your Forum Questions

Not completing your data may sometimes cause delay in getting an answer.

How can I do that , if data belongs to company and it is protected ? Please, advice on it .

please review the video in the link in the previous message. It will take you through the process on how to deal with confidential data.
thanks
Keith

it’s been a while since we got a response from you @Iwona

Just following up if you still need help with your inquiry?

If you do, kindly provide the information the experts requested above so they can help you further.

In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.

Hi @Iwona, here are some videos that may help you masking sensitive data and create datasets and data models representative of your problem:

Hi @Iwona, due to inactivity, we will be tagging this post as solved. Kindly untick the solution box if you want to open the topic again. It is advisable to follow the process on masking sensitive data to prevent any security/privacy issues.

Thanks