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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.