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
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
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.