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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Laila92
Helper V
Helper V

Using TreatAs for Zendesk data

I am trying to build a report with Zendesk data. Since the connector from withing PBI Desktop is broken, I opened the data in an app and then connected from my powerbi desktop to the app, with a live connection. 

 

Now I can connect to the data model, but not change anything to the model. So I have a calendar table, and other tables that are not connected to the data table, see image.Capture.PNG

 

I want to show charts by month etc. , so to connect the measures to the Calendar table. I tried using TREATAS and FILTER functions, but to no avail. The Measures I write stay empty.


What I tried:

Test = 

CALCULATE(COUNT(Tickets[id]), TREATAS(VALUES('Calendar'[Date]),Tickets[created_at]))

 

This gave me an entirely empty table.
I also tried 

Test = 

CALCULATE(COUNT(Tickets[id]), TREATAS(SUMMARIZE('Calendar','Calendar'[Date]),Tickets[created_at]))

Also gave an empty table. What am I missing?

4 REPLIES 4
v-deddai1-msft
Community Support
Community Support

Hi @Laila92 ,

 

Based on my test,  your formula works well in lc mode. Would you please check if the data type of Ticket[create_at] is the same as Calendar[Date]?

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

amitchandak
Super User
Super User

@Anonymous , Try measures like

 

Test =
var _min = minx(allselected('Calendar'),'Calendar'[Date])
var _max = minx(allselected('Calendar'),'Calendar'[Date])
return
CALCULATE(COUNT(Tickets[id]), filter(Tickets, Tickets[created_at] >= _min && Tickets[created_at] <= _max))

 

or

 

Test =
var _date = allselected('Calendar'[Date])
return
CALCULATE(COUNT(Tickets[id]), filter(Tickets, Tickets[created_at] in _date))

@amitchandak this also gives a whole blank column.
@Anonymous yes, there are values in the id column

Anonymous
Not applicable

Have you checked if the is data in the tickets table ?

Have you checked if the is data in the calender table ?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.