<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic DAX - To see Group = X and date=today ? I'm Lost in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-To-see-Group-X-and-date-today-I-m-Lost/m-p/4377601#M173802</link>
    <description>&lt;P&gt;Morning all,&lt;/P&gt;&lt;P&gt;Ive been using BI for ages but normally with SQL and I can just write the SQL statement as I like but with DAX im lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, Ive found out I can get data directly from our WildIX phone system, I want to get two figures, incoming calls from group "Office" and one Outgoing from group "Office" for today.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I go about this, i would like it to always be today and not a date ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can help that would be great, im sorry but im really finding DAX hard i wish it was the same as SQL.......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So im using the below (But with passwords and usernames obs)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;&lt;BR /&gt;aud = "cds-ca",&lt;BR /&gt;scope = "get",&lt;BR /&gt;dateFrom = "2025-01-01",&lt;BR /&gt;dateTo = "2025-12-30",&lt;/P&gt;&lt;P&gt;baseAuth = "Basic " &amp;amp; Binary.ToText(Text.ToBinary(user &amp;amp; ":" &amp;amp; pass), BinaryEncoding.Base64),&lt;/P&gt;&lt;P&gt;personalTokenResponse = Web.Contents(pbxUri &amp;amp; "api/v1/personal/token/?service=auth.wildix.com",&lt;BR /&gt;[&lt;BR /&gt;Headers = [&lt;BR /&gt;Authorization=baseAuth,&lt;BR /&gt;#"User-Agent"="WildixAuthUtils/1"&lt;BR /&gt;]&lt;BR /&gt;]&lt;BR /&gt;),&lt;BR /&gt;personalTokenJson = Json.Document(personalTokenResponse),&lt;BR /&gt;personalToken = personalTokenJson[result][token],&lt;/P&gt;&lt;P&gt;authAccessTokenResponse = Web.Contents("&lt;A href="https://auth.wildix.com/api/v2/Token/" target="_blank" rel="noopener"&gt;https://auth.wildix.com/api/v2/Token/&lt;/A&gt;", [Headers=[Authorization="Bearer "&amp;amp; personalToken]]),&lt;BR /&gt;authAccessUserTokenJson = Json.Document(authAccessTokenResponse),&lt;BR /&gt;authAccessUserToken = authAccessUserTokenJson[result][accessToken],&lt;/P&gt;&lt;P&gt;authOpenIdTokenResponse = Web.Contents("&lt;A href="https://auth.wildix.com/api/v2/OpenId/service/" target="_blank" rel="noopener"&gt;https://auth.wildix.com/api/v2/OpenId/service/&lt;/A&gt;",&lt;BR /&gt;[Content = Json.FromValue([aud = "cds-ca", scope = "scope"]),&lt;BR /&gt;Headers = [&lt;BR /&gt;Authorization = "Bearer " &amp;amp; authAccessUserToken,&lt;BR /&gt;#"User-Agent"="WildixAuthUtils/1",&lt;BR /&gt;#"Content-Type"="application/json"&lt;BR /&gt;]&lt;BR /&gt;]&lt;BR /&gt;),&lt;BR /&gt;authOpenIdTokenJson = Json.Document(authOpenIdTokenResponse),&lt;BR /&gt;openIdToken = authOpenIdTokenJson[result][id_token],&lt;/P&gt;&lt;P&gt;targetServiceResponse = Web.Contents("&lt;A href="https://cds-ca.wildix.com/v1/calls" target="_blank" rel="noopener"&gt;https://cds-ca.wildix.com/v1/calls&lt;/A&gt;",&lt;BR /&gt;[&lt;BR /&gt;Headers = [&lt;BR /&gt;Accept = "application/json",&lt;BR /&gt;Authorization = "Bearer " &amp;amp; openIdToken&lt;BR /&gt;],&lt;BR /&gt;Query = [&lt;BR /&gt;dateFrom = dateFrom,&lt;BR /&gt;dateTo = dateTo&lt;BR /&gt;]&lt;BR /&gt;]&lt;BR /&gt;),&lt;BR /&gt;targetServiceData = Json.Document(targetServiceResponse),&lt;BR /&gt;items = targetServiceData[items],&lt;BR /&gt;#"Converted to Table" = Table.FromList(items, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;BR /&gt;#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"callCalleeCompany", "callCalleeDevice", "callCalleeEmail", "callCalleeGroupId", "callCalleeGroupName", "callCalleeMos", "callCalleeName", "callCalleePhone", "callCalleeType", "callCalleeUserExtension", "callCalleeUserId", "callCallerCompany", "callCallerDevice", "callCallerEmail", "callCallerGroupId", "callCallerGroupName", "callCallerMos", "callCallerName", "callCallerPhone", "callCallerType", "callCallerUserExtension", "callCallerUserId", "callDestination", "callEndBy", "callEndCause", "callEndCauseStr", "callGroupId", "callGroupName", "callMergeWith", "callRecordings", "callRemoteCountryCode", "callRemoteCountryCodeStr", "callRemoteLocation", "callRemotePhone", "callSplitReason", "callSplitTransferType", "callTrunkDirection", "callTrunkName", "conferenceId", "conferenceSubject", "connectTime", "connectTimeMs", "direction", "duration", "durationMs", "flags", "id", "part", "pbx", "service", "serviceNumber", "sessionId", "startTime", "status", "tags", "talkTime", "talkTimeMs", "time", "type", "waitTime", "waitTimeMs"}, {"callCalleeCompany", "callCalleeDevice", "callCalleeEmail", "callCalleeGroupId", "callCalleeGroupName", "callCalleeMos", "callCalleeName", "callCalleePhone", "callCalleeType", "callCalleeUserExtension", "callCalleeUserId", "callCallerCompany", "callCallerDevice", "callCallerEmail", "callCallerGroupId", "callCallerGroupName", "callCallerMos", "callCallerName", "callCallerPhone", "callCallerType", "callCallerUserExtension", "callCallerUserId", "callDestination", "callEndBy", "callEndCause", "callEndCauseStr", "callGroupId", "callGroupName", "callMergeWith", "callRecordings", "callRemoteCountryCode", "callRemoteCountryCodeStr", "callRemoteLocation", "callRemotePhone", "callSplitReason", "callSplitTransferType", "callTrunkDirection", "callTrunkName", "conferenceId", "conferenceSubject", "connectTime", "connectTimeMs", "direction", "duration", "durationMs", "flags", "id", "part", "pbx", "service", "serviceNumber", "sessionId", "startTime", "status", "tags", "talkTime", "talkTimeMs", "time", "type", "waitTime", "waitTimeMs"})&lt;BR /&gt;in&lt;BR /&gt;#"Expanded Column1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jan 2025 08:19:32 GMT</pubDate>
    <dc:creator>Benc7777</dc:creator>
    <dc:date>2025-01-24T08:19:32Z</dc:date>
    <item>
      <title>DAX - To see Group = X and date=today ? I'm Lost</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-To-see-Group-X-and-date-today-I-m-Lost/m-p/4377601#M173802</link>
      <description>&lt;P&gt;Morning all,&lt;/P&gt;&lt;P&gt;Ive been using BI for ages but normally with SQL and I can just write the SQL statement as I like but with DAX im lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, Ive found out I can get data directly from our WildIX phone system, I want to get two figures, incoming calls from group "Office" and one Outgoing from group "Office" for today.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I go about this, i would like it to always be today and not a date ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can help that would be great, im sorry but im really finding DAX hard i wish it was the same as SQL.......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So im using the below (But with passwords and usernames obs)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let&lt;BR /&gt;&lt;BR /&gt;aud = "cds-ca",&lt;BR /&gt;scope = "get",&lt;BR /&gt;dateFrom = "2025-01-01",&lt;BR /&gt;dateTo = "2025-12-30",&lt;/P&gt;&lt;P&gt;baseAuth = "Basic " &amp;amp; Binary.ToText(Text.ToBinary(user &amp;amp; ":" &amp;amp; pass), BinaryEncoding.Base64),&lt;/P&gt;&lt;P&gt;personalTokenResponse = Web.Contents(pbxUri &amp;amp; "api/v1/personal/token/?service=auth.wildix.com",&lt;BR /&gt;[&lt;BR /&gt;Headers = [&lt;BR /&gt;Authorization=baseAuth,&lt;BR /&gt;#"User-Agent"="WildixAuthUtils/1"&lt;BR /&gt;]&lt;BR /&gt;]&lt;BR /&gt;),&lt;BR /&gt;personalTokenJson = Json.Document(personalTokenResponse),&lt;BR /&gt;personalToken = personalTokenJson[result][token],&lt;/P&gt;&lt;P&gt;authAccessTokenResponse = Web.Contents("&lt;A href="https://auth.wildix.com/api/v2/Token/" target="_blank" rel="noopener"&gt;https://auth.wildix.com/api/v2/Token/&lt;/A&gt;", [Headers=[Authorization="Bearer "&amp;amp; personalToken]]),&lt;BR /&gt;authAccessUserTokenJson = Json.Document(authAccessTokenResponse),&lt;BR /&gt;authAccessUserToken = authAccessUserTokenJson[result][accessToken],&lt;/P&gt;&lt;P&gt;authOpenIdTokenResponse = Web.Contents("&lt;A href="https://auth.wildix.com/api/v2/OpenId/service/" target="_blank" rel="noopener"&gt;https://auth.wildix.com/api/v2/OpenId/service/&lt;/A&gt;",&lt;BR /&gt;[Content = Json.FromValue([aud = "cds-ca", scope = "scope"]),&lt;BR /&gt;Headers = [&lt;BR /&gt;Authorization = "Bearer " &amp;amp; authAccessUserToken,&lt;BR /&gt;#"User-Agent"="WildixAuthUtils/1",&lt;BR /&gt;#"Content-Type"="application/json"&lt;BR /&gt;]&lt;BR /&gt;]&lt;BR /&gt;),&lt;BR /&gt;authOpenIdTokenJson = Json.Document(authOpenIdTokenResponse),&lt;BR /&gt;openIdToken = authOpenIdTokenJson[result][id_token],&lt;/P&gt;&lt;P&gt;targetServiceResponse = Web.Contents("&lt;A href="https://cds-ca.wildix.com/v1/calls" target="_blank" rel="noopener"&gt;https://cds-ca.wildix.com/v1/calls&lt;/A&gt;",&lt;BR /&gt;[&lt;BR /&gt;Headers = [&lt;BR /&gt;Accept = "application/json",&lt;BR /&gt;Authorization = "Bearer " &amp;amp; openIdToken&lt;BR /&gt;],&lt;BR /&gt;Query = [&lt;BR /&gt;dateFrom = dateFrom,&lt;BR /&gt;dateTo = dateTo&lt;BR /&gt;]&lt;BR /&gt;]&lt;BR /&gt;),&lt;BR /&gt;targetServiceData = Json.Document(targetServiceResponse),&lt;BR /&gt;items = targetServiceData[items],&lt;BR /&gt;#"Converted to Table" = Table.FromList(items, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;BR /&gt;#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"callCalleeCompany", "callCalleeDevice", "callCalleeEmail", "callCalleeGroupId", "callCalleeGroupName", "callCalleeMos", "callCalleeName", "callCalleePhone", "callCalleeType", "callCalleeUserExtension", "callCalleeUserId", "callCallerCompany", "callCallerDevice", "callCallerEmail", "callCallerGroupId", "callCallerGroupName", "callCallerMos", "callCallerName", "callCallerPhone", "callCallerType", "callCallerUserExtension", "callCallerUserId", "callDestination", "callEndBy", "callEndCause", "callEndCauseStr", "callGroupId", "callGroupName", "callMergeWith", "callRecordings", "callRemoteCountryCode", "callRemoteCountryCodeStr", "callRemoteLocation", "callRemotePhone", "callSplitReason", "callSplitTransferType", "callTrunkDirection", "callTrunkName", "conferenceId", "conferenceSubject", "connectTime", "connectTimeMs", "direction", "duration", "durationMs", "flags", "id", "part", "pbx", "service", "serviceNumber", "sessionId", "startTime", "status", "tags", "talkTime", "talkTimeMs", "time", "type", "waitTime", "waitTimeMs"}, {"callCalleeCompany", "callCalleeDevice", "callCalleeEmail", "callCalleeGroupId", "callCalleeGroupName", "callCalleeMos", "callCalleeName", "callCalleePhone", "callCalleeType", "callCalleeUserExtension", "callCalleeUserId", "callCallerCompany", "callCallerDevice", "callCallerEmail", "callCallerGroupId", "callCallerGroupName", "callCallerMos", "callCallerName", "callCallerPhone", "callCallerType", "callCallerUserExtension", "callCallerUserId", "callDestination", "callEndBy", "callEndCause", "callEndCauseStr", "callGroupId", "callGroupName", "callMergeWith", "callRecordings", "callRemoteCountryCode", "callRemoteCountryCodeStr", "callRemoteLocation", "callRemotePhone", "callSplitReason", "callSplitTransferType", "callTrunkDirection", "callTrunkName", "conferenceId", "conferenceSubject", "connectTime", "connectTimeMs", "direction", "duration", "durationMs", "flags", "id", "part", "pbx", "service", "serviceNumber", "sessionId", "startTime", "status", "tags", "talkTime", "talkTimeMs", "time", "type", "waitTime", "waitTimeMs"})&lt;BR /&gt;in&lt;BR /&gt;#"Expanded Column1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 08:19:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-To-see-Group-X-and-date-today-I-m-Lost/m-p/4377601#M173802</guid>
      <dc:creator>Benc7777</dc:creator>
      <dc:date>2025-01-24T08:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - To see Group = X and date=today ? I'm Lost</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-To-see-Group-X-and-date-today-I-m-Lost/m-p/4378441#M173830</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="734563" data-lia-user-login="Benc7777" class="lia-mention lia-mention-user"&gt;Benc7777&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try the following approach:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IncomingCallsToday = 
CALCULATE(
    COUNTROWS('FACT_TABLE'),
    'FACT_TABLE'[callCalleeGroupName] = "Office",
    'FACT_TABLE'[direction] = "Incoming",
    'FACT_TABLE'[startTime] &amp;gt;= TODAY(),
    'FACT_TABLE'[startTime] &amp;lt; TODAY() + 1
)
&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;OutgoingCallsToday = 
CALCULATE(
    COUNTROWS('FACT_TABLE'),
    'FACT_TABLE'[callCallerGroupName] = "Office",
    'FACT_TABLE'[direction] = "Outgoing",
    'FACT_TABLE'[startTime] &amp;gt;= TODAY(),
    'FACT_TABLE'[startTime] &amp;lt; TODAY() + 1
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 23 Jan 2025 20:21:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-To-see-Group-X-and-date-today-I-m-Lost/m-p/4378441#M173830</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2025-01-23T20:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - To see Group = X and date=today ? I'm Lost</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-To-see-Group-X-and-date-today-I-m-Lost/m-p/4379263#M173845</link>
      <description>&lt;P&gt;Hi Sahir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for trying to help I really appriciate it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added the measure but when i try to add to a visual i get this ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Is there something I can do or have i done something worng ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 07:36:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-To-see-Group-X-and-date-today-I-m-Lost/m-p/4379263#M173845</guid>
      <dc:creator>Benc7777</dc:creator>
      <dc:date>2025-01-24T07:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - To see Group = X and date=today ? I'm Lost</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-To-see-Group-X-and-date-today-I-m-Lost/m-p/4381713#M173947</link>
      <description>&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Thanks for the reply from Sahir_Maharaj&amp;nbsp;, please allow me to provide another insight:&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&lt;SPAN&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="734563" data-lia-user-login="Benc7777" class="lia-mention lia-mention-user"&gt;Benc7777&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Thanks for reaching out to the Microsoft fabric community forum.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;The issue you're encountering is quite common and is usually due to inconsistencies in data types when comparing characters. Please check the data type of your startTime column, which is the date-time column, and ensure it is at least set to "Date".&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;" lang="zh-CN"&gt;We recommend debugging in Power Query.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Note that if the data type conversion fails, it might be due to inconsistent format recognition. Typically, the default format is "MM/DD/YYYY" or "YYYY/MM/DD". If your format is "DD/MM/YYYY", you can try selecting other regions, such as French-speaking countries, where the reference format will be displayed.&lt;/P&gt;
&lt;P style="margin: 0in;"&gt;&lt;SPAN&gt;&lt;img /&gt;For more details, please refer to the relevant documentation to ensure consistency in data types and formats.&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;BR /&gt;&lt;/SPAN&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-data-types" target="_blank"&gt;&lt;SPAN&gt;Data types in Power BI Desktop - Power BI | Microsoft Learn&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&lt;BR /&gt;We hope these suggestions help resolve your issue. If you have any further questions, feel free to reach out to us at any time.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Best Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;Leroy Lu&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Arial; font-size: 12.0pt; color: black;"&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider Accept it &lt;EM&gt;&lt;STRONG&gt;as the solution &lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 05:42:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-To-see-Group-X-and-date-today-I-m-Lost/m-p/4381713#M173947</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-27T05:42:37Z</dc:date>
    </item>
  </channel>
</rss>

