power query
76 TopicsApply Conditional Formatting to a Column and am seeking assistance
Hello All, I would like to apply conditional formatting to a column and am seeking assistance. My goal is to enable users to select a color that will automatically be applied to a column header in Power BI, based on data sourced from Excel. For instance, if a user selects '1', the color should be green; for '2', blue; and for '3', red. Please be aware that the report is updated monthly. Therefore, as users change values in Excel each month, these changes should be dynamically reflected in Power BI. I'm facing a challenge with applying conditional formatting to a column instead of a row. If you have a more effective way to model the data, your suggestions would be greatly appreciated. My brain is a bit fatigued, just want to see column conditional formatted.đ Can anyone provide a solution for this? I have included a screenshot below for better clarity.Solved5.1KViews0likes4CommentsGrouping Values by Multiple Criteria in several Tables (DAX or Power Query and big Flat Table)
I have donât this in the past with data from our ERP with Power Query when it was one big flat table. However, I am hitting a big wall trying to do this in Power BI with many related tables. I need to create some groupings in Power BI for tables and charts. I have looked at several examples, but most seem to have a less complicated data model. I had considered Power Query, but I need to kook at multiple related tables and did not want a massive flat table again. The DAX I saw was confusing and there seemed to be some cautions. I have 5-7 different groupings (A, B, C, D, EâŠ). I have actual expense and budget tables. In order for an amount to be summed into one of the categories it must meet several criteria that are in different related tables. It must Be in a certain Account Rage Be in certain Cost Centers, Be a specific Project Type Output might look like this Category 2025 Actuals YTD 2025 Projection 2026 Budget 2027 Budget 2028 Budget A 14143 14134 326 3453 433 B 2356 354 3533 5353 3452 C 3423 3497 3534 4345 3455 D 2324 2345 3533 3535 5352 E 2567 2599 5632 3567 3572 I can create a single measure to do one category but, I am really after either a ârealâ table via Power Query or a DAX query. Below is an example a measure if I were creating category A as a single measure for Actuals. Help ang guidance from multiple angles would be appreciated. Thanks Alan For example, for Category A measure might look like this, unfortunately I need that as a ârowâ not a new column. A = VAR _Amount = CALCULATE ( SUM ( 'Actuals'[Amount4] ), KEEPFILTERS ( VALUE ( 'Account Relations'[Head Account] ) >= 50000 && VALUE ( 'Account Relations'[Head Account] ) <= 69999 && VALUE ( 'Account Relations'[Head Account] ) <> 56950 ), KEEPFILTERS ( VALUE ( 'Account Relations'[Account] ) <> 96910 && VALUE ( 'Account Relations'[Account] ) <> 96950 ), KEEPFILTERS ( VALUE ( 'Main Project Master File - PMF'[PMF Project Type] ) >= 30 && VALUE ( 'Main Project Master File - PMF'[PMF Project Type] ) <= 69 ), KEEPFILTERS( VALUE('Department Relations'[Cost Center]) >=10 && VALUE( 'Department Relations'[Cost Center]) <= 20 ) ) RETURN _AmountSolved1.2KViews1like5CommentsIndex Column Based on Filtered Data in Table Visual
Hi I have a table visual with three columns of data in Power BI, and I would like to add an index column that starts from 1 and increments by 1 up to the number of rows in the Name column. Specifically, when the data in the table is filtered, the index column should update to reflect the number of rows in the filtered result. Name- calculated column from app table and contains duplicates Age- measure City- measure Index- start the sequence from 1 and ends at the no of rows of the name column in the table visual. Duplicates should not effect the sequence. Sample Data (Before Filtering): Index Name Age City 1 John 25 New York 2 Alice 26 London 3 Bob 22 Tokyo 4 John 28 Berlin 5 Michael 15 Sydney Sample Data (After Filtering for "Age > =25"):we use slicer for the filter purpose Index Name Age City 1 John 25 New York 2 Alice 26 London 3 John 28 Berlin As you can see, the index should reset based on the filtered data, providing a new row number for each filtered result. Could someone suggest the best way to implement this dynamic index in my Power BI report? Thank you!Solved1.1KViews0likes1CommentPowe Query - How do get the ttl count of the column is >0?
Hi All, i have a table as follow and would like to add a column custom column (TTL Item as follow) in power query that counts all the rows that are >= 1, i have found multiple formulas but they didn't calculate correctly. Can you please help? Name Apple Banana Grapes TTL Item John 1 2 2 Mary 2 1 David 1 3 4 3 Tom 1 1 2Solved617Views0likes2CommentsCustom Slicer based on Grouped Cell Values in a column
Hello, I am trying to create custom slicers that allow me to select a "category" instead of a cell value. This is what I have currently: a b c a1 b1 c1 a2 b2 c2 a3 b3 c3 a4 b4 c4 a5 b5 c5 a6 b6 c6 Suppose b1, b2, b5 belong to "Category 1", b3 and b6 belong to "Category 2", and b4 is "Category 3". I want to create a slicer that has 3 options: Categories 1, 2, and 3, such that it filters my table based on the selected category/categories. For example, if I select Category 1, the output should be: a b c a1 b1 c1 a2 b2 c2 a5 b5 c5 How can I achieve this? Thank you. Really appreciate your help!Solved771Views0likes3CommentsCalculate TRIMMEAN of last 12 months from raw sales data
I have a table containing quantity of each stock item sold per invoice. This includes date and I have a related Date table. I need to sum the quantity sold for each stock item monthly for the last 12 months then calculate the TRIMMEAN of this monthly data where high and low months are excluded. Do I need to create a new table for the rolling 12 months where each column is a month then create a measure for the TRIMMEAN? If so, how do I create this table? The issue is that I want to exclude outlying months and I can't find an example that sums the sales by date and then calculates the trimmed mean. I am also very new to this so may be misunderstanding what I've seen. If there is a better way please let me know. Thanks.Solved1.3KViews2likes5CommentsTrouble using DAX to calculate properly between multiple active/inactive relationships
Hello, I'm trying to understand if leveraging the Power BI relationships is a good place to do this, or if it's better suited to something like Power Query, or if we just write a database query that gives the proper output. We've been trying to get away for having so many custom views in the database so I'm trying with in app relationships first. In my scenario, the data source is a relational database with several tables. We have unique IDs tied to individual users, and there is a People Table that holds all of the user information such as their Names. I have to retrieve the names for multiple fields, which means Power BI needs a mix of active and inactive relationships established. Screenshots of the relationships are at the bottom of the post. Another workaround we thought of that I don't like is having multiple/separate queries pull the ID and Name from the people table and we have an active relationship and a new query for every named individual I'm trying to surface. The main active relationship I started with was joining 'report er_log' [lead_project_manger_id] to 'report people' [id]. I'm using a simple IF statement that successfully returns the Lead Project Manager name when those two IDs match - success! Lead PM Name = IF('report er_log'[lead_project_manager_id]=RELATED('report people'[id]),RELATED('report people'[full_name])) The issue comes in for the inactive relationship between 'report activity' [record_owner_id] to 'report people' [id]. Any formula I've used that didn't throw a relationship error will ignore the inactive relationship entirely and just return the PM Name. e.g. my latest attempt was using LOOKUPVALUE. my understanding is that LOOKUPVALUE should ignore relationships but it definitely doesnt and just gives me PM names and not all record owners LOOKUPVALUE('report people'[display_name],'report people'[id],'report activity'[record_owner_id]) My first attempt was using a simple IF statement. this also just returns PM names and has issues because RELATED only likes the active relationships IF('report activity'[record_owner_id]=RELATED('report people'[id]),RELATED('report people'[full_name])) The only thing i found that might work for the USERLATIONSHIP function throws an error because in this context there's no active relationship with report people CALCULATE(RELATED('report people'[display name]),USERELATIONSHIP('report activity'[record_owner_id],'report people'[id])) Any ideas are appreciated. I'm starting to play with Power Query, and worst case I think my workaround will be fine... I just don't want to have so many distinct queries going to report people if we can help it. EDIT: I tried the workaround for funsies and it seems like the same relationship issue with the original people table is still causing heartache.Solved897Views0likes3CommentsTransformar filas con valor repetido a columna. Power Query
Buenas tardes: Tengo una tabla denomida "Tabla Actual" cuya columna "nÂș" tiene valores repetidos y estos valores querĂa traspasarlos a columnas segĂșn la figura que adjunto. AgraderĂa ayuda para hacer la transformaciĂłn usando power query en Power BI. Muchas gracias. West.Solved472Views0likes1CommentGrouping dates into fortnights
Hi everyone, I'm looking for a solution that will help in grouping dates into fortnights, irregardless of month or year. I'll attach an image to help understand what I am meaning. It wouldn't matter if the column started at calendar start or a specific date. The date table I have is just an invoked funtion in M. Hopefully someone can help, I'm not sure what other information I could provide that would be helpful here.Solved4.2KViews0likes2Comments