0

I have trouble setting in Powerbi a tile table with 4 field and 2 measurement where the second measurement has depenency on the first.

I have a data table with 4 field.

  1. Task Categories
  2. Tasks
  3. Target Date
  4. Completion Date

categories and tasks are never null but both dates can be null. My first measuremet is days to complete and it works fine between target date and current date and completion date. So a table with 5 columns where the fifth is this measurement is fine.

Problem start when i try to add second measuremt which should have been simple. Second measurement is status of task (which means based on value of first measurement if it is Completed on time , with delay, not completed etc.)

The table is filterd with a slicer for one category always. When i place the status measurement in the tile, instead of getting the calculation for the tasks of the specific category, the tile gives me all tasks (like there is no filter at all)

I tried to split the last measurement in variables so i tried to return instead of the real calculation step by step what i could in order to find when the tile breaks and instead of giving 5 tasks for a category it gives 7 tasks from all categories which is the complete data table.

You can see the code below of the second measurement. The error does not come when i return each of these variables that you can see.

  • So first variable which is the first measurement also is ok

  • Also completion date comes properly

  • Errors comes when i try to do if statement of first measurement with a value. Instead of giving just true or false to 5-6 records of the category it brings all the data.

Status of Completion = 
var mes1 = [Days To Complete]
var cmp_date=SELECTEDVALUE(task_table[completion_date])
var result=
IF (
    mes1 = 0,
    "Completed on time",
    IF (
        mes1 < 0,
        IF (
            ISBLANK ( cmp_date ),
            "On time",
            "Completed in advance"
        ),
        IF (
            ISBLANK ( mes1 ),
            "Not Planned Yet",
            IF (
                ISBLANK ( cmp_date ),
                "In delay",
                "Completed with delay"
            )
        )
    )
)
return mes1=0

Is it a reason for this or aa workarround?

kyrpav
  • 756
  • 1
  • 13
  • 43
  • I am not sure what the measure is supposed to return. Do you want to list the number of tasks for a given category? If you just want to "add an extra column" for each row of the table to show the status, calculated columns look feasible – rasenkantenstein Jun 28 '20 at 18:35
  • i want a measure placed in a table visual that can calculate the status. The page is filtered by category and the table has one row for each task. – kyrpav Jul 16 '20 at 07:10

0 Answers0