@power bi desktop
12 TopicsPercentage Calculation using multiple tables columns -DAX Function
Greetings, I have three table(s) in Semantic layer and have one-to-many with bi-directional relationship between tables and I have shown the sample DAX function the below I have used for my reports. Table-1: has only one record per id Table-2: can have many records and the grain is name and Id Table-3: can have many records and the grain is name, outcome Table-1 Table -2 Bi-directional - One to Many Table-1 Table-3 Bi-directional - One to Many Outcome %= DIVIDE(SUM('Table-2'[Hours]) , CALCULATE( SUM('Table-2'[Hours]), ALLSELECTED('Table-3'[Outcome]) ) ) Category Group %= DIVIDE(SUM('Table-2'[Hours]) , CALCULATE( SUM('Table-2'[Hours]), ALLSELECTED('Table-3'[Category Group]) ) ) Question-1: I have created data group column on category and when I use data group column percentage, its working as expected but if I create the column in Power query using category and use the column in percentage like the below, it’s not working as expected. Any thoughts on this. Category Group %= DIVIDE(SUM('Table-2'[Hours]) , CALCULATE( SUM('Table-2'[Hours]), ALLSELECTED('Table-3'[Category Group]) ) ) Question -2: I have created Donut chart or pie chart or graph, its working for one specific column either category or outcome. If I drill down to Category Group from Outcome or from Category Group to Category, it's not working as expected and showing the values as 100%. I have changed the logic the below this but no luck Category Group %= DIVIDE(SUM('Table-2'[Hours]) , CALCULATE( SUM('Table-2'[Hours]), ALLSELECTED('Table-1'[Category Group]) , 'Table-1'[Category ]) ) ) Is there any way to write a single Dax measure to support all three combinations to create percentage metric. I have shown the sample table the below for your quick reference. Table-2 Name Category Category Grp Outcome Total Hours Grand Total Percentage Outcome Percentage Outcome Grp Percentage Name-1 Category -1 Category -1 Outcome -1 7 19 36.84211 = (7/19)*100 = 7/19 *100 Name-1 Category -2 Category -2 Outcome -2 4 19 21.05263 = (7/19) *100 =4/19*100 Name-1 Category -6 Other Outcome -2 3 19 15.78947 = (7/19) *100 =8/19*100 Name-1 Category-8 Other No Outcome 5 19 26.31579 =(5/19) *100 =8/19*100 Do you have any other recommendations ? Thanks you in advance for your help on this. Table-2 Table-3 Table -1 ID Table 2 Name ID Outcome ID name Category Category Group Hours 1 Name -1 1 Outcome -1 1 name 1 Category -1 Category -1 5 2 Name -1 2 Outcome -1 2 name 2 Category -1 Category -1 2 5 Name -1 5 Outcome -2 3 name 3 Category -1 Category -1 4 8 Name-1 8 Outcome -2 4 name 4 Category -2 Category -2 3 10 Name-1 10 No Outcome 5 name 5 Category -2 Category -2 5 6 name 6 Category -2 Category -2 5 7 name 7 Category -5 Category -2 3 8 name 8 Category -6 Other 2 9 name 9 Category -7 Other 6 10 name 10 Category -8 Other 6Solved1.6KViews0likes2CommentsHelp with DAX when Multiple measures are used in Matrix
Hello All, This is very easy & silly DAX mistake I am doing, new to DAX so need your help to acheive the result. Attaching my sample pbix file here PowerBi Sample . If you see there I have a matrix visual where i have used multiple measures to calculate the count of cases on few conditions. Issue is when i click onany of the columns value belos printed table doesn't filter it properly. It is showing total row values. I want if i click on App team's implementation value, Table also show only those lines. Please help me with this asap. Thanks in Advance1.1KViews0likes5Commentsidentifying active users every month
Hi, I have a list of users every month, and i need to find the active users in every month. maybe by creating a new calculated column which states if the user is active or not - If the user names present in the next available month file then those user names are active or - if a new user appears for the very first time which are not available in any of the month files then they are active from that month onwards. Please note if user names not appearing continuously then they are inactive. please find the data like below: column names are: System user name,Count of System user name,Sum of cost,Monthly Source file Name System user name Count of System user name Sum of cost Monthly Source file Name User_A 3 € 112.50 24-Jan User_A 3 € 112.50 24-Mar User_A 3 € 112.50 24-Apr User_A 3 € 112.50 24-May User_A 3 € 112.50 24-Jun User_A 3 € 112.50 24-Sep User_B 7 € 149.50 24-Mar User_B 7 € 149.50 24-Apr User_B 7 € 149.50 24-May User_B 7 € 149.50 24-Jun User_B 8 € 238.50 24-Sep User_C 5 € 139.50 24-Jan User_C 7 € 151.50 24-Mar User_C 7 € 151.50 24-Apr User_C 7 € 151.50 24-May User_C 7 € 151.50 24-Jun User_C 7 € 151.50 24-Sep User_D 12 € 323.00 24-Jan User_D 13 € 329.00 24-Mar User_D 13 € 329.00 24-Apr User_D 13 € 329.00 24-May User_D 13 € 329.00 24-Jun User_D 14 € 332.00 24-Sep User_E 5 € 138.50 24-Jan User_E 7 € 209.50 24-Mar User_E 7 € 209.50 24-Apr User_E 9 € 222.50 24-May User_E 9 € 222.50 24-Jun User_E 9 € 305.00 24-Sep User_F 11 € 362.50 24-Jan User_F 13 € 374.50 24-Mar User_F 14 € 380.50 24-Apr User_F 14 € 380.50 24-May User_F 14 € 380.50 24-Jun User_F 14 € 463.50 24-Sep User_G 6 € 219.50 24-Apr User_G 7 € 226.00 24-May User_G 6 € 219.50 24-Jun User_G 7 € 246.50 24-Sep User_H 3 € 112.50 24-Mar User_H 3 € 112.50 24-Apr User_H 3 € 112.50 24-May User_H 3 € 112.50 24-Jun User_H 3 € 112.50 24-Sep How do i create this Active users list every month using the above data in power bi?? Thanks in advance for the helpSolved1.5KViews0likes2CommentsFiltering by histogram bins in Power BI
Hi Everyone, In Power BI I have created a histogram that shows Number of People per Attendance Rate. To do so I have created additional table that defines the ranges for the histogram, which looks like this: HistogramBins: IDBinMaxMin 1 0-20% 0.2 0 2 20-40% 0.4 0.2 3 40-60% 0.6 0.4 4 60-80% 0.8 0.6 5 80-100% 1.01 0.8 Then I created the measure that would count how many people falls into each range by Attendance rate: Number of people per range = VAR minbin = SELECTEDVALUE('Histogrambins'[Min]) VAR maxbin = SELECTEDVALUE('Histogrambins'[Max]) VAR segment = FILTER( ADDCOLUMNS( SUMMARIZE('People', 'People'[ID]), "@Attendance", [% Attendance rate]), [@Attendance] < maxbin && [@Attendance] >= minbin) RETURN CALCULATE([Number of People], segment) It works nice for the Histogram itself, but I would like to add the option to click on Histogram bins and to have the rest of the report filtered for People[ID] that fall into each range. In the report I have slicer with Period (which is selected to show last 6 months) and an overview of Attendance rate per month which uses the measure % Attendance rate: % Attendance rate = DIVIDE ([Number of People]), [Number of Invitees]). It works when I am not filtering by histogram bins. I have tried to use CONCATENATEX list of People ID and then to filter the meausre by CONTAINSSTRING using People ID from the People table that is connected to People ID in the Attendance table, but when I click on specific bin, in the overview by month, it omits the months when Attendance rate falls below selected range per this month. I would like to separate somehow the inital range of Attendance rate from the second calculation of the Attendance rate so when I, for example, click on range 80-100% I would see the overview for people that fall into this range for selected period, even if for some months in the selected period, it falls below 80%. Would appreciate any help or hint.1.8KViews0likes4CommentsNeed help Calculate Prior year values working for one other filter
Hi , I am working on the data where I am calculating the sum of appointments total by prior fiscal year. to calculate the prior year values , I have used a calculation suggested by this forum, it works fine when we select year filter, but the moment I select other filter this calculation prior year calculation doesnot hold good. How do I correct it ? This is the calculation I am using to calculate previous year calculate(sum('OLD ONE'[COUNT(DISTINCT APT)]),filter(ALL('OLD ONE'),[FISCAL_YEAR_NUM]=SELECTEDVALUE('OLD ONE'[FISCAL_YEAR_NUM])-1)) Now I want this calcualtion to work for other region level filter too . the moment I chose a region filter the prior year filter is not workingSolved601Views0likes2CommentsColumn Name Changes Every Month
Hello Everyone, This Data set has multiple columns where in Column 7 to Column 12 gets refreshed ever month. Example : For this month data starts from Jan 2023 to June 2023 For next month data starts from Feb 2023 to july 2023 Here Column 7 starts from jan 2023, Column 8 starts from Feb 2023, Column 9 start from mar 2023,,, Column with jun 2023 For next month Column 7 start with Feb 2023, Column 8 start with Mar 2023,,, Column 12 with July 2023 The requirement is 1) All the Column present in the data set should be placed in TABLE Visualization only. Problem : 1) when ever the Current month data is added to table Visualization ie., jan 2023 to Jun 2023 the visual looks fine. 2) as data gets refreshed next month (next month data start from. Feb 2023 to July 2023) Table visualization has only Feb, mar, Apr, may, jun. Where in July 2023 is not added to table visual as the Column name got changed hence my visual Breakdown. Need Help •Can we achieve this by index •Can we achieve this by dax with column7 is replaced by Apr 2023 •can we achieve this by power query dynamically • is there any way to achieve this.Solved1.1KViews0likes5CommentsUnable to retrieve unique case number based on Message Date in Power Bi Desktop
Hello All, Can someone please help me to resolve the below issue. I have this table where in message date is the response received on the case number) and date/time closed is when the case was closed. I am trying to display only unique casenumber based on the latest message date along with timestamp. As you can see "00854913" case number is displayed twice as the message date timestamp is 6:55 PM & 1:47 PM.Solved403Views0likes1CommentAverage values of a column within the week before with conditions in the month before
I have a table 'TableSales' with 3 columns 'Date' (in date format), 'Cashier', 'Sale Amount', and another table 'TableDate' with 2 columns 'SelectedDate' (in date format) and 'SelectedDate_text' (date but in text format so that I can have the last date as "The latest day" instead of the date). I use 'TableDate'[SelectedDate_Text] to create a slicer so that users can choose a desired date. I would like to create a measure to calculate the average Sale Amount of Cashiers per day during the latest 7 days until the selected date in the slicer. I can do that with the following query: average = CALCULATE( SUM('TableSales'[Sale Amount])/COUNT('TableSales'[Cashiers]) ,FILTER('TableSales', 'TableSales'[Date <= MAX('TableDate'[SelectedDate]) && 'TableSales'[Date >= MAX('TableDate'[SelectedDate])-6)) However, now I want to filter out all Cashiers with Sale Amount = 0 or blank during the latest 1 month until the selected date because those cashiers are assumed to be broken and shouldn't be taken into the calculation of average. How should I include that into my measure? Thank you.686Views0likes3CommentsPrinting content of web link in power bi table [ column] in one go
I have use case , A table has column mnamed LINK. it hold https link to a pdf content. there will be more rows in table with link as column. I am trying find solution to have button [ one click] does below. 1. Iterates all the links in LINK column 2. hit the link and get the PDF content one by one 3. Send the pdf to printer. How can i achieve this ?530Views0likes1CommentDax Formula Help - For given columns and filter value SUM another column
I have inputted the data set below and power bi report layout I would like to acheive Basically I need to know the DAX formula for SUM (VarGroup) for given PolicyNumber, WS Instance, penedid,Coverage Date, where status = Active Report PolicyNumber Cov Eff Date Auto Added Endorsement Code Endorsement Title Endorsement Effective Date Cancel Date Endorsement Expiry Date Signature Required Signed by Policyholder VarGroup GE 1 36131 September 1, 2017 No SC001 Exclusion July 1, 2015 No 5 GE 1 36131 September 1, 2016 No SC001 Exclusion July 1, 2015 No 5 GE 1 36131 September 1, 2015 No SC001 Exclusion July 1, 2015 No 5 GE 1 36131 September 1, 2014 No SC001 Exclusion July 1, 2015 No 5 GE 1 36131 September 1, 2014 No SC001 Exclusion September 1, 2014 June 30, 2015 No GE 1 36131 September 1, 2013 No SC001 Exclusion September 1, 2010 No 2 GE 1 36131 September 1, 2012 No SC001 Exclusion September 1, 2010 No 2 Data PolicyNumber Auto Added Endorsement Code Endorsement Title Endorsement Effective Date Cancel Date Cov Eff Date Endorsement Expiry Date Signature Required Signed by Policyholder Name Values WS Instance Pen ENDID Status Detail ID Variable ID VarGroup GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2014 No Excluded from ABC Tokyo 851110 4902931 Active 3183723 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2014 No Excluded from ABC Tsuk 851110 4902931 Active 3183721 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2014 No Excluded from ABC Towa 851110 4902931 Active 3183722 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2014 No Excluded from ABC Hanwa 851110 4902931 Active 3183724 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2014 No Excluded from ABC Jap 851110 4902931 Active 3183725 1187 1 GE 1 36131 No SC001 Exclusion September 1, 2014 June 30, 2015 September 1, 2014 No Excluded from ABC Hanwa 851110 4902930 Cancelled 3183718 1187 GE 1 36131 No SC001 Exclusion September 1, 2014 June 30, 2015 September 1, 2014 No Excluded from ABC Towa 851110 4902930 Cancelled 3183716 1187 GE 1 36131 No SC001 Exclusion September 1, 2014 June 30, 2015 September 1, 2014 No Excluded from ABC Tsuk 851110 4902930 Cancelled 3183715 1187 GE 1 36131 No SC001 Exclusion September 1, 2014 June 30, 2015 September 1, 2014 No Excluded from ABC Jap 851110 4902930 Cancelled 3183719 1187 GE 1 36131 No SC001 Exclusion September 1, 2014 June 30, 2015 September 1, 2014 No Excluded from ABC Tokyo 851110 4902930 Cancelled 3183717 1187 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2017 No Excluded from ABC Jap 100028 6570804 Active 4492710 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2017 No Excluded from ABC Tsuk 100028 6570804 Active 4492706 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2017 No Excluded from ABC Towa 100028 6570804 Active 4492707 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2017 No Excluded from ABC Tokyo 100028 6570804 Active 4492708 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2017 No Excluded from ABC Hanwa 100028 6570804 Active 4492709 1187 1 GE 1 36131 No SC001 Exclusion September 1, 2010 September 1, 2013 No Excluded from ABC Tsuk 765825 4014096 Active 2558828 1187 1 GE 1 36131 No SC001 Exclusion September 1, 2010 September 1, 2013 No Excluded from ABC towa 765825 4014096 Active 2558829 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2016 No Excluded from ABC Hanwa 995382 6510535 Active 4445863 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2016 No Excluded from ABC Tsuk 995382 6510535 Active 4445860 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2016 No Excluded from ABC Tokyo 995382 6510535 Active 4445862 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2016 No Excluded from ABC Towa 995382 6510535 Active 4445861 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2016 No Excluded from ABC Jap 995382 6510535 Active 4445864 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2015 No Excluded from ABC Tokyo 908778 5507017 Active 3664358 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2015 No Excluded from ABC Tsuk 908778 5507017 Active 3664356 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2015 No Excluded from ABC Towa 908778 5507017 Active 3664357 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2015 No Excluded from ABC Hanwa 908778 5507017 Active 3664359 1187 1 GE 1 36131 No SC001 Exclusion July 1, 2015 September 1, 2015 No Excluded from ABC jap 908778 5507017 Active 3664360 1187 1 GE 1 36131 No SC001 Exclusion September 1, 2010 September 1, 2012 No Excluded from ABC Tsuk 697648 3354307 Active 2111839 1187 1 GE 1 36131 No SC001 Exclusion September 1, 2010 September 1, 2012 No Excluded from ABC towa 697648 3354307 Active 2111840 1187 1Solved512Views0likes2Comments