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
erhodes
Advocate II
Advocate II

Graph multiple measure that use different dates???

I have a fact table that has rows for service tickets. The table includes collumns for Date Requested, Date Created, Date Finished, and Status (there are others, but they are not important for the issue at hand). Currently, the Fact table is connected to a date table using the Date Requested Field.

 

I created 2 measures:

# of Tickets Created = Countrows(FactTBL)

# of Completed Tickets = Calculate(Countrows(FactTBL),Status="Complete")

 

I need to plot the # of tickets created and the # of tickets completed by Month. But, i need the number completed to be based on when they were completed and the number created based on when they were created. Currently, the chart is showing the values based on the Date Requested field.

ex.

 

IDDate RequestedDate CreatedDate FinishedStatus
11/1/20161/5/20162/1/2016Complete
22/1/20162/1/20163/15/2016Complete
32/1/20162/8/2016 Open
43/1/20163/5/20164/10/2016Complete

 

based on the example above should show for Jan 1 created an 0 completed, for Feb. 2 created and 1 completed, for Mar 1 created and 1 complete. and for April 0 created and 1 complete. That's not what i am getting. Any suggestions on how to resolve this?

1 ACCEPTED SOLUTION

Thank you for your assistance. The formula you provided didn't work for me. However, I was able to find a soltuion. I created an inactive relationships for the date fields in my fact table not currently connected to the date table. I wrote the measures that I needed and then wrote another measure using =USERELATIONSHIP. Worked like a charm

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi erhodes,

 

Based on your description, you want to let the measure work on each row, right?

 

If it is a case, you can refer to below code:

 

Test table:

Capture.PNG 

 

# of Completed Tickets =

var temp= Calculate(Countrows(TestTable),FILTER(ALL(TestTable),COUNTX(FILTER(TestTable, [Status]="Complete"&& MONTH( TestTable[Date Created])=MONTH( EARLIER(TestTable[Date Finished]))),TestTable[Date Finished])))

return

if(temp>0,temp,0)

 

# of Tickets Created =

var temp= Calculate(Countrows(TestTable),FILTER(ALL(TestTable),COUNTX(FILTER(TestTable, MONTH( TestTable[Date Created])=MONTH( EARLIER(TestTable[Date Created]))),TestTable[Date Created])))

return

if(temp>0,temp,0)

 

Result:

Capture2.PNG

 

Notice: ‘# of Tickets Created’ measure displays the total tickets created in the same month.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you for your assistance. The formula you provided didn't work for me. However, I was able to find a soltuion. I created an inactive relationships for the date fields in my fact table not currently connected to the date table. I wrote the measures that I needed and then wrote another measure using =USERELATIONSHIP. Worked like a charm

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.