Power BI - How to view zeros in the matrix table visual - powerbi

I'm currently building a report in Power BI. I added a matrix table along with its data. The matrix table just consist of sums per column (shown below).
There are multiple of slicers I have for the report. The problem is when I start filtering, the data disappears from the matrix. Instead of disappearing, I want it those values to be zero.
I have already used the measure: IF(ISBLANK(SUM(COUNT)), 0, SUM(COUNT) And it still did not work (shown below). What should I do so that the zeroes would appear on the matrix table?

There are two things you need for this approach to work
You need your Categories in a separate table to the rest of your data (joined by category ID) - if you don't have an ID, you can get away with Category name). You can build this table in DAX with something like CategoryTable = DISTINCT(MyData[CategoryName]). This new table and your data table need to be linked with a relationship. On your visual, use the Category from the Categories table and the measure you have created.
Make sure "Show items with no data" is checked on the matrix's fields.

Related

How to get 1 column in a table report filtered by a slicer not in sync with the table

I am a PowerBi beginner and would like to know if it is possible to create a table report that behaves like explained in the attached picture (according to the fact table I have).
I tried to do it with a DAX measure using the following formulas but it does not work as I wish :
CALCULATE(SUM('Fact'[Invoice]),'Fact'[Customer] = SELECTEDVALUE('Fact'[Customer]))
CALCULATE(SUMX('Fact','Fact'[Invoice]),'Fact'[Customer]=SELECTEDVALUE('Fact'[Customer]))
The slicer does not filter the table in order to get all the product in the table even if the customer did not buy one.
Is it possible to do it ?
Many thanks

Table visual is unintuitively aggregating my data

I am loading an Excel file, in which it has 43 rows, all the rows are identical. This is the only file I'm loading and there are no connections relationships in the model whatsoever.
When I plot my data into a table visual, and choose not to summarize any of my fields, Power BI still shows me one row. While if I change any of the field to do a count of it, it shows me correctly that I have 43 rows. I need to be able to see all the 43 rows in my table.
Why is Power BI summarizing my data even if I command it not to do so?
Am I missing something simple?
Input table as seen in Power BI data tab:
The visual I'm trying to create:
The table visual in Power BI behaves similar to a Pivot Table in Excel.
W/o an aggregation defined, the "Values" fields behave like "Rows" in a Pivot Table and you will only see distinct items or distinct item combinations. You have 43 identical records, hence it is represented as one row in the visual.
With an aggregation defined (Sum, Count, ...) the field behaves like "Values" in a Pivot Table, and you get the result of that aggregation, filtered by the distinct items/combinations to the left, which is again one row in your case.
If you just want to show all the records in a table visual, you'll have to make them unique. The easiest way to achieve that is by adding an index column in PowerQuery and then also showing that index in the table visual.
However, this is not exactly what Power BI is made for and you are probably better off by switching to something like PowerPoint instead.
And btw., newer show sceenshots in stackoverflow, always provide sample data instead.

Power BI / DAX return values from table from rows filtered out by slicer

I have a table visualisation that shows the populations of countries and a toggle switch that flips between 'sold' and 'unsold'. (This works with a measure that checks is a country is present in a sales table and assigns a 1 or 0 which is then used as a filter on the table visualisation).
Various slicers in the dashboard are used to filter the data model and retain the details of sales. When 'unsold' is selected therefore, the relevant countries are already filtered out of the countries data table and it is not possible to display them with their populations.
At the moment the workaround is to use a duplicate countries table that only has a one way filter, so that the rows remain regardless of filtering. This means that other slicers which interact with the rest of the data model don't filter the table visualisation as desired.
I am sure this must be possible using some combination of CALCULATE(), FILTER() and ALL() but I haven't managed to achieve this.
N.B. I can force the unsold countries to appear in a table visualisation using a constant measure (with formula: measure_name = 0) in a column .
Apologies if this is not very well explained, any help much appreciated.
Thanks for reading,
S
Image attached to (hopefully!) explain problem better.
Real scenario is more complicated hence not screenshotting from PBI.

Power BI Prevent Duplicate Removal

It looks like Power BI is doing some form of SQL Union logic when combining data from two or more tables on a table visual.
In the image above you can see there are only two rows displayed. Within the data however there are in fact 4 rows, and all are valid to me. When I add another column that is distinct per row, it shows the data I expect. See image below:
I have two questions, can I change this default behavior?
If not, can I hide a column within a table visual while still having its data affect the display? That OrderDetailKey has no value to my users, which is why I didn't display it in the first place.

DAX Joint value

I am trying to create a measure in DAX to find the joint value (sum) of a fact table by filtering two dimension tables to have the same column value.
Here's an image of the relationship
Each Department in Users are linked to table Registret. They are giving resources to projects. The table Projects are Taking Resourcs. What I am trying to accomplish is a measure that can find the amount a department uses of it's own resources. So I figure if I can filter Registret[Users] and Registre[Project] where Users[Department] = Projects[Department] I would get the value.
I'd like to use the Projects[Department] as a basis. So that table below would show the amount of internal department registration by each Department in Projects.
Department(Projects) InternalRegistration
A Value
B Value
So far I've been trying with something like
CALCULATE(Registret[Registret]; FILTER(Users; Users[Department] IN ALLSELECTED(Projects[Departments])))
But this will only show the correct value if I in a slicer single out a Department from table Projects. Is it possible the solution is some Joint table between Users and Projects?
Edit:
The top table shows the matrix of joint values in Registret between Users and Projects.
Edit2:
Image of my table data.
Notice that the filter arrows only point downward. This means that selecting Projects[Departments] isn't going to filter Users[Departments] since there is no filter path connecting them. You are also missing the SUM function in your measure.
Try tweaking your measure to the following:
= CALCULATE(SUM(Registret[Registret]);
FILTER(Users; Users[Department] = SELECTEDVALUE(Projects[Departments])))
If you're working in a matrix or a table, the SELECTEDVALUE should pick up the row/column filter context from the visual, whereas ALLSELECTED only picks up filter context from slicers or report/page/visual level filters.
You can also use ...IN VALUES(... instead of ...= SELECTEDVALUE(....
= CALCULATE(SUM(Registret[Registret]),
FILTER(Users, Users[Department] IN VALUES(Projects[Department])))
Both of these should produce the following: