The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a datamodel where I have a fact table 'ZMM_INDI - uden dubletter'. This table is connected to a dimension table 'Suppliers' on Supplier ID. The table suppliers has more suppliers than represented in the fact table ' ZMM_INDI - uden dubletter'.
When I add the measure 'Lagerdækning/uger (avg 30 dage) to a visual table, then I get duplicated rows like this. I would expect only to see the first row with the value 0,61.
The measure 'Lagerdækning/uger (avg 30 dage) is calculated like this:
Lagerdækning/uger (avg 30 dage) =
VAR TotalAntal = 'ZMM_INDI - Uden dubletter'[Beholdning minus udløbet]
RETURN
IF(
TotalAntal = 0,
0,
calculate(30 / 7 * divide(TotalAntal, sumx('ZMM_INDI - Uden dubletter', 'ZMM_INDI - Uden dubletter'[Udleveret 30 dage (basisenhed)])
)))
What causes the problem with duplicated rows in the visual table?
Best regards
Morten
Solved! Go to Solution.
The whole row is not duplicated. What you see is powerbi giving you all the combinations of the dimension and fact table for which the measure returns a non-blank value.
This part
IF(
TotalAntal = 0,
0,
returns a 0 for all rows where the measure Beholdning minus udløbet is 0. I don't know what that measure does but it looks like it returns 0 for all the combination that could be in the visual
--
In powerbi, we sometimes use this feature to our advantage by adding 0 to a measure, for example, show me all the customers who have sales and also show me the customers who have no sales. The measure above does something similar
--
In any powerbi visual, when a measure returns blank, the rows will be removed from that visual.
@HotChilli Thank you for the explanation. The variable 'TotalAntal' uses 'ZMM_INDI - Uden dubletter'[Beholdning minus udløbet], which calculates how much is in stock minus the amount that has expired. I took over the data model from someone else, so I don't know why we want to show 0 instead of just blank.
The whole row is not duplicated. What you see is powerbi giving you all the combinations of the dimension and fact table for which the measure returns a non-blank value.
This part
IF(
TotalAntal = 0,
0,
returns a 0 for all rows where the measure Beholdning minus udløbet is 0. I don't know what that measure does but it looks like it returns 0 for all the combination that could be in the visual
--
In powerbi, we sometimes use this feature to our advantage by adding 0 to a measure, for example, show me all the customers who have sales and also show me the customers who have no sales. The measure above does something similar
--
In any powerbi visual, when a measure returns blank, the rows will be removed from that visual.
User | Count |
---|---|
74 | |
70 | |
39 | |
30 | |
28 |
User | Count |
---|---|
108 | |
96 | |
51 | |
48 | |
48 |