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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Column from a measure with filters, need to apply to all rows


Hi there,

I am very stuck at the moment.

I want to calculate a value from known value and a known total aka a ratio, and then apply this to all other rows in a table.

Ratio = known count of items from an area / known total from a specific location

 

_ratiocalc = (CALCULATE([Calc1],Table1[Column1]="String1")/ CALCULATE(sum(Table2[Column2]),Table2[Column3]="String2"))

 

It would be :

TotalCount = [_ratiocalc] * Table2[Column2]

eg: where ratio = 0.9

|Column3|Column2|TotalCount|
|a| 1000| ? |
|b| 2000 | ? |
|string2| 3500 | 3150 |

However, when I apply this calculation, ONLY the row where hospital = x shows an accurate value. the others are infinity symbol.

I did try to use the below to make a temp variable _RatioStatic and "all" & "filter" to show all, but that didn't work. 

 

_RatioStatic = CALCULATE([_ratiocalc],filter(all(Table2[Column3]),Table2[Column3]),filter(all(Table1[Column1]),Table1[Column1]))

Any help would be really great!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@amitchandak 

Thank you !

 

Actually, using this formula as a column worked and calculated as required! - where _ratioStatic is a measure.
TotalCount = calculate([_RatioStatic],all()) * Table2[Column2]

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@amitchandak 

Thank you !

 

Actually, using this formula as a column worked and calculated as required! - where _ratioStatic is a measure.
TotalCount = calculate([_RatioStatic],all()) * Table2[Column2]

amitchandak
Super User
Super User

@Anonymous , You can not use a measure in a column. Think in term of new measure

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.