Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hallo,
I want to divide two values. In a tabel I can use filter to exclude the blank values but if I take out the dimension rows then the filter doesn't work any more. Here my data:
I want to divide columnA and columnB, but only if columA and columnB have values on the same row (per name):
In table I can use filter ...is not blank
But in KPI it just doesn't work:
Is there any solution in DAX for dit case? The KPI value shoud be 75%.
Solved! Go to Solution.
Hi @Jana2102
It is always important that when providing a sample data to describe where the numbers are from. Also, in the future please post a sample data that we can copy paste to Excel.
I modifed my formula a bit to point them to different tables but I am seeing 75%.
Please see the attached sample pbix.
Great work @danextian. This helps me futher. I get the results what I need.
Thank you very much.
Hi @Jana2102
Assuming that columns A and B have multiple rows for each Name and the numbers in your table are aggregates of these rows, try this:
Percentage =
-- Create a variable _TBL that filters summarized data
VAR _TBL =
FILTER (
-- Summarize the table by 'Name' and calculate sums for 'columnA' and 'columnB'
SUMMARIZECOLUMNS (
'Table'[Name], -- Group by 'Name'
"@colA", CALCULATE ( SUM ( 'Table'[columnA] ) ), -- Sum of 'columnA'
"@colB", CALCULATE ( SUM ( 'Table'[columnB] ) ) -- Sum of 'columnB'
),
-- Remove rows where either @colA or @colB is blank
NOT ( ISBLANK ( [@colA] ) ) && NOT ( ISBLANK ( [@colB] ) )
)
RETURN
-- Calculate the percentage as the sum of @colA divided by the sum of @colB
DIVIDE ( SUMX ( _TBL, [@colA] ), SUMX ( _TBL, [@colB] ) )
@danextian thanks for your idea.
The columns are from 3 different tables:
- 'dim_Employee' [Name]
- 'fact_Hours_Registered' [colA]
- 'fact_Hours_Planned' [colB]
With your solution I don't get the result, what I'd like to see. I get 138,6% and not 75%.
Stil any idea?
Hi @Jana2102
It is always important that when providing a sample data to describe where the numbers are from. Also, in the future please post a sample data that we can copy paste to Excel.
I modifed my formula a bit to point them to different tables but I am seeing 75%.
Please see the attached sample pbix.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 20 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 51 | |
| 37 | |
| 30 | |
| 26 |