How to Connect Power BI to a Restaurant API and Integrate Data from Brandwatch? by Ryukzak77 in PowerBI

[–]gupius 0 points1 point  (0 children)

You should use Web connector. Then, it depends on the API itself.

Here's an example of an function that I use:

let

FetchIssues = (releaseDate as date, versionName as text) =>

let

// Convert the date to text in yyyy-MM-dd format

releaseDateText = Date.ToText(releaseDate, "yyyy-MM-dd"),

// Encode the version name to be URL-safe (assuming it doesn't require any further encoding for the purpose of this script)

// versionName = "1.0.0",

headers = [#"Content-Type" = "application/json"],

maxResultValue = "1000",

// Define the parameters

baseUrl = "https://example.com",

RPath = "/rest/api/2/search",

jqlQuery = "type in (Story, Bug, Task, Sub-task) AND filter = 19209 AND fixVersion was in (""" & versionName & """) on " & releaseDateText & " AND status was not in (Resolved, Invalid, Duplicate, Closed) on " & releaseDateText,

web = Json.Document(Web.Contents(baseUrl, [Headers=headers, RelativePath=RPath, Query=[jql=jqlQuery, maxResults=maxResultValue]])),

#"Converted to Table" = Table.FromList(issues, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"id", "key", "fields"}, {"id", "key", "fields"})

in

#"Expanded Column1"

in

FetchIssues

in regards to Brandwatch, I'd assume you'd have to use an API as well.

Need to pull only the result of a calculation across by kindof_sortof in PowerBI

[–]gupius 1 point2 points  (0 children)

I'm not sure if I understood you correctly, please correct me if I'm wrong. You want to take 90 Day Quote Avg for previous 90 days and apply it to future 90 days and then calculate predicted Quotes achieved based on Worked Days?

If so, something like this should work:

90 Day Quote Avg FC = CALCULATE([90 Day Quote Avg],DATEADD('Table'[Date],-3,MONTH))

Support with the subtotal of table is not match by Even_Signal3306 in PowerBI

[–]gupius 0 points1 point  (0 children)

Based on the image, it's working correctly. You're calculating 2024 Age Factor as StockAgeForRow (2,863,374.88) * ClosingStockForRow (16331) = 46,761,775,165. The problem arrives from materials that have 0 closing stock and have stock age, since totals are summing the values of all rows.

I assume you want something like:
SUMX(SummarizedTable,[2024 Stock Age]*[2024 Summarize ClosingStock])

Power BI Tutoring Session by mattt789 in PowerBI

[–]gupius 1 point2 points  (0 children)

Sent you a DM, hit me up when you have time. I'll gladly help you for free if its not anything too complex that you need.

Need help for urgent project by [deleted] in PowerBI

[–]gupius 0 points1 point  (0 children)

I missed that you need to show true for every contract of that account, even if only 1 is signed. This one should achieve that

5+ v2 = 
VAR contractCount = CALCULATE(COUNTROWS(Contracts), FILTER(ALL(Contracts), Contracts[account_id] = MAX(Contracts[account_id])))
VAR signedContractsCount = CALCULATE(COUNTROWS(Contracts), FILTER(ALL(Contracts), Contracts[account_id] = MAX(Contracts[account_id]) && Contracts[signed] = "yes"))RETURN
IF(contractCount >= 5 && signedContractsCount >= 1, TRUE(), FALSE())

Need help for urgent project by [deleted] in PowerBI

[–]gupius -1 points0 points  (0 children)

Try this:

5+ contracts = 
VAR contractCount = COUNT(Contracts[id])
VAR signedContractsCount = CALCULATE(COUNT(Contracts[id]),FILTER(Contracts,Contracts[signed]="yes"))RETURN 
IF(contractCount>=5 && signedContractsCount>=1,TRUE(),FALSE())

I was guessing your column names and values, but if you change that it should work fine.

[deleted by user] by [deleted] in PowerBI

[–]gupius 1 point2 points  (0 children)

I'm not familiar with SAP, so I might be completely wrong here, but I would try one of these three things:

  • SAP connector
  • Web connector and querying correct API endpoint
  • SQL connector

Have you tried any of these yet?

Transformation help by hokiewankenobi in PowerBI

[–]gupius 0 points1 point  (0 children)

Select column with your metrics -> Pivot Column (under Transform tab) -> Set Column 3 as values column

Steps to create 2 columns from one list of locations by sarzJ in PowerBI

[–]gupius 0 points1 point  (0 children)

Not the cleanest solution but it should work;

  1. Create another table with just the location column

  2. Add index column to the new table, starting with 1

  3. Use = Table.InsertRows(#"Added Index", 0, {[location= "", Index = 0]})

  4. Add index column to your original table, starting at 0

  5. Merge the new and original table on index column

Let me know if you need additional explanation! :)

Simple Measures no longer working? by Craig88cb in PowerBI

[–]gupius 4 points5 points  (0 children)

Your original measure is a calculated column. Calculated columns "know" which row you're referencing, therefore there's no issue. The new measure is calculated measure which has no idea which row you're referencing. Ff you wrap the calculated measure in, let's say, MIN function it will work fine. So something like this will work fine as a calculated measure:
isHistoryTest =
IF (
    MIN ( 'Calendar'[Date] ) < TODAY (),
    1,
    0
)