nead help
12 TopicsUpload pbix with python
Hi! I have Power BI Report Server May 2022 and i try to upload pbix-file use api. I write this code: from asyncio.windows_events import NULL from requests import request import requests from requests_toolbelt.multipart.encoder import MultipartEncoder import json from requests_ntlm import HttpNtlmAuth from urllib3.exceptions import InsecureRequestWarning from urllib3 import disable_warnings disable_warnings(InsecureRequestWarning) urlpbirs = "https://pbirs.ontoso.com/reports/api/v2.0/PowerBIReports" file = open("testapi.pbix", "rb") file_location = "testapi.pbix" files = {'value': (None, open(file_location, 'rb'), 'multipart/form-data')} mp_encoder = MultipartEncoder(fields=files) headers = { 'accept': 'application/json', # Already added when you pass json= but not when you pass data= # 'Content-Type': 'application/json', } json_data = { 'Name': 'test', 'Description': 'test api with python', 'Type': 'PowerBIReport', 'Hidden': False, 'IsFavorite': False, 'ContentType': NULL, 'Content': '', 'HasDataSources': True, 'Path': '/BI Test' } r = requests.post(url=urlpbirs, data=mp_encoder, auth=HttpNtlmAuth( 'user', 'pass'), verify=False, headers=headers, json=json_data) But it doesn't work2KViews0likes2CommentsNot able to Upload csv file into Power BI to create Dataflow
In premium license I was trying to upload a csv file to create a dataflow to perform AutoML,when I click browse button and after choosing the csv file, I was not able to upload the CSV file.No errors were shown but a warning. Do I need to enable any option on the admin portal to upload the csv file?1.5KViews0likes2CommentsHow to calculate ABS value
Hi, I need ur help that I need to calculate the difference between the number of actual sales and forecast sales, but the positive value and negative value shoudn't be offset, so I need to calculate the absolute difference. And here is my situation, please refer to the link: https://drive.google.com/file/d/1-JcZDiK5D7cm9BwCj4h4g7o_u-g1rnlX/view?usp=sharingSolved708Views0likes1CommentRow number as index column for table created with DAX command
Halllo, I have a table that I created with a DAX command. I now need a column with the row number (simply 1,2,3...). I cannot create this column with power query, because the table does not appear in the power query. I have now found a hint that this is not possible. Is this correct? Thanks for hints FriedbertSolved953Views0likes2CommentsHow to display the same cumulative value on one month?
Hello, I am trying to display same cumulative value of one month by selecting one month from a filter. I have attached my Pbix file. As illustrated, currently, cumulative value of March 2022 is 35 M. But, when I select only one month from the Date Range slicer, I get different amount (11.4 M): I think I might have to fix the measure for CumSales, and I need your help. CumSales = CALCULATE( SUM(Revenue[Amount]), filter(allselected('Calendar'), 'Calendar'[Date] <=max('Calendar'[Date]) ) ) Thanks.Solved654Views0likes2CommentsHow to reference a value on related table
I am trying to write a measure (DSO_Measure) that I could reference a value (DaysInMonth) on dim table (Calendar) because there are relationships with other two Fact tables (AR_Aging & Transactions) to do a calculation. This is a measure (DSO_Measure) I am trying to write to do a calculation: I tried with as shown on the bottom, but it did not get the right calculation numbers. There is a relationship between two Fact tables (AR_Aging & Transactions) and Calendar (dim) table. Bottom is an image for the dim table (Calendar). I only captured the portion of image for February 2022 value (DaysinMonth), which is 28. How do I express so that it could reference the right month? For this case, it should only point to 28 for February 2022. If it is January or December, it should reference 31 in the Calendar table. If it is November or September, it should reference 30 in the Calendar table, etc.. Thanks.Solved756Views0likes1CommentUpload button on web portal vs. 'saving as' on server option in Power BI Desktop for RS
Hi, I'm a bit confused, what are the differences between the two options of uploading reports on a server ? 1) Using the "upload" button directely in the webportal, and upload a .pbix file. 2) Use Power BI Desktop for RS with an user account that has credential for the server, and "save as" ? Is possible to upload the dataset as well with option 1 ? Thanks in advance for your helpSolved1.1KViews0likes2CommentsHow to get select column1 from table where column2 = xyz in a table variable to reuse it?
I wanted to do achieve this “sql” code in a DAX variable Select WeekYearWeekNumber from DimDate where Date = today()+7 How can achieve it? So far I have this code, but the last line doesn’t work because nextw is more than a column… var nextw = FILTER( SUMMARIZE('Date','Date'[Week Year Week Number],'Date'[Date]) , 'Date'[Date]=TODAY()+7 ) var NextWCS = FILTER( SUMMARIZE(Staff, Staff[K_Emp], Staff[StaffingType], 'Date'[Week Year Week Number], Staff[IsTmed], "sumat", SUM(Staff[Hours]) ), 'Date'[Week Year Week Number]=nextw )Solved1.4KViews0likes3CommentsCreate a dax to get count of events occurred in specific time
I have a data like like event_time_utc 12/18/2021 8:50:07 PM 12/18/2021 8:51:47 PM 12/18/2021 8:53:10 PM 12/18/2021 8:53:30 PM 12/18/2021 8:54:10 PM 12/18/2021 8:56:47 PM I am trying to create metrics to display No. of events that occurred in 1.5 min. So for example, I have a Bus that is GPS enabled and I am getting one entry in my table whenever there is a break applied in Bus or Bus took left or right direction means any movement. If you see data, the bus starts on 12/18/2021 at 8:50:07 PM, so let's take event count as 1, and we keep comparing the event time interval with the next event and will see If the next event is within 1.5 min or more than that. As per data our second event was triggered at 12/18/2021 8:51:47 PM and If we see the difference it is 1.66 which is greater than 1.5, so now our event count will become 2, similarly see the next event is 12/18/2021 8:53:10 PM and if we see the difference it is 2.61 so still the count will become 3, now see the next event 12/18/2021 8:53:30 PM and if we see the difference it is 0.33 which is less than 1.5 so the count will be 3 only. Now let's see the next event 12/18/2021 8:54:10 PM, If we see the difference it is 1.33 which is less than 1.5 so the count will be still 3, next event 12/18/2021 8:56:47 PM, If we see the difference it is 2.61 which is greater than 1.5 so our count will increase to 4 and logic continues like that only in short, If we are taking the difference between two events and If the difference between consecutive events is less than 1.5 Min then we will consider all those events as one bucket and once we see the difference between events is greater than 1.5 then the count will increase by 1 and in this way we keep calculating the count of events. So, In the above example, I am expecting my value as 4 that I want to show in my card visual. At high level: event_time_utc Eventdiff Cnt1.5 Min 12/18/2021 8:50:07 PM 0 1 (start) 12/18/2021 8:51:47 PM 1.66 2 12/18/2021 8:53:10 PM 2.61 3 12/18/2021 8:53:30 PM 0.33 3 12/18/2021 8:54:10 PM 1.33 3 12/18/2021 8:56:47 PM 2.61 42KViews0likes5CommentsApply related value of Processing Date (month)
I am sharing Pbix file here (Google drive) for you to take a look. Basically, I need to fix this DAX code or do something to apply value that is related to different Processing Date. I have three processing dates (April, May and June 2021). This is DAX code that I had originally usingTOPN function, but I cannot apply this any longer, but retrieve the value based on Processind Date. So, I need a guidance to modify this code. Currently, the calculation of "MaxPtsHighestPotnetialStars" is using only one value (April 2021's value = 78.67 because of ASC) of MaxTotalWHSS instead of applying thru different month's value. Where or how do I apply in DAX to follow the Processing Date for that particular month? I have created a third table between two tables for the ProcessingDate. Expected outcomes are: April: 78.67 May: 79.33 June: 79.33 Currently all same (wrong): April: 78.67 May: 78.67 June: 78.67 I have tried as below, but no luck yet: CALCULATE ( SELECTEDVALUE( vw_MxTtWghtdHlthSrvyScr[MaxTotalWHSS]), //TOPN (1, FILTER ( ALL(vw_MxTtWghtdHlthSrvyScr), CurrentTestValue <= vw_MxTtWghtdHlthSrvyScr[MaxTotalWHSS] && vw_MxTtWghtdHlthSrvyScr[ProcessingDate] = SELECTEDVALUE('Date Bridge'[ProcessingDate]) ) //vw_MxTtWghtdHlthSrvyScr[MaxTotalWHSS] //DESC //) )Solved1.2KViews0likes4Comments