- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to create a static column in a table in power bi
Hi,
I want to create a static column in a table in Power BI, i.e., the values of a particular column should not change if I change my slicer values. Below is the detailed explaination of scenarion:
I have the data as follows:
Data | ||
Category | Parent | Sales |
a | abc | 100 |
a | def | 200 |
b | abc | 300 |
b | def | 400 |
Now I am creating 3 measures for this data set. The first 2 are same to calculate sum and the 3rd is to find the difference between the 2.
3 measures |
sales = SUM(Sales) |
Total sales = SUM(Sales) |
Relative Sales = total Sales - Sales |
Then I am using Power bI table to show the following data:
Power BI Table | |||
Category | Sales | Total Sales | Relative Sales |
a | 300 | 300 | 0 |
b | 700 | 700 | 0 |
and for slicer I am using Parent value as slicer
Filter |
Parent |
abc |
def |
Now if I am not selecting anything in this slicer I am getting my relative sales as 0 which is fine but if I select my Parent as abc for the filter
Filter |
Parent |
abc |
def |
I am expecting the below result:
Power BI Table | |||
Category | Sales | Total Sales | Relative Sales |
a | 100 | 300 | 200 |
b | 300 | 700 | 400 |
In the above table you can see that the values of sales changes according to the filter but value of Total Sales remained static. So how do I get this functionality working in power BI?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi, replace TotalSales measure with:
Total sales = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Category]))
Lima - Peru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi, replace TotalSales measure with:
Total sales = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Category]))
Lima - Peru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
07-31-2023 10:25 AM | |||
06-06-2024 05:29 AM | |||
01-03-2024 11:22 AM | |||
04-16-2024 02:41 PM | |||
Anonymous
| 07-08-2024 09:07 PM |
User | Count |
---|---|
141 | |
117 | |
80 | |
65 | |
47 |