Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Measure for Line diagramm

Hi!

 

I am kind of new to PowerBI and I wanted to do a ratio. So I figured I can divide somehow like this:

 

Test = 1 - DIVIDE(CALCULATE(COUNT('Table1'[A]), FILTER('Table1','Table1'[A] = "Closed")),COUNT('Table1'[B]))
 
This works perfectly fine with cards, because PowerBI calculates ALL "Closed" Cases by the number of all cases,
but I want to show it in a line diagramm and the calculation does something i did not expect:
 
It calculates:
All closed cases on a date / All cases on a date
 
But what I wanted to do is the following:
All closed cases UNTIL a date / All cases UNTIL a date
 
All help is very appreciated!
 
Best regards
MSOMME
1 ACCEPTED SOLUTION
Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Anonymous ,

You can create a Running Total measures for them: For ex:

Test=
Var A= CALCULATE(CALCULATE(COUNT('Table1'[A]), FILTER('Table1','Table1'[A] = "Closed")), FILTER(ALLSELECTED(Table1[Date]), Date <= MAX( Table[Date])))

Var B= CALCULATE(COUNT('Table1'[B]), FILTER(ALLSELECTED(Table1[Date]), Date <= MAX( Table[Date])))

Return (1- DIVIDE(A,B))

 

I hope this helps!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

That worked as solution. Thank you! 🙂

Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Anonymous ,

You can create a Running Total measures for them: For ex:

Test=
Var A= CALCULATE(CALCULATE(COUNT('Table1'[A]), FILTER('Table1','Table1'[A] = "Closed")), FILTER(ALLSELECTED(Table1[Date]), Date <= MAX( Table[Date])))

Var B= CALCULATE(COUNT('Table1'[B]), FILTER(ALLSELECTED(Table1[Date]), Date <= MAX( Table[Date])))

Return (1- DIVIDE(A,B))

 

I hope this helps!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.