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
Lenihan
Helper III
Helper III

Cross Table formulas not working

Hi!

Having some challenges again getting some dax basic formulas to do some proper calculations

 

The 3 tables relevant to this are :

1) All CIs

2) Config Metrics - Updated.

3) Data table (this is a calculated table created with a unique key created following these instructions - https://pbidax.wordpress.com/2016/06/03/connect-any-number-of-tables-together-via-a-common-column/

 

Every table (except Data table) has a column called "Reporting Month". I have January 2017 and February 2017 as the values. 

 

I need to calculate the % of CIs updated in the month. So, take # updated per month, and divide by total # of CIs that month. 

 

First is: 

UpdatedTotal = counta('Config Metrics - Updated'[CI Identifier])    

This is Total count of CIs updated in the month. This will be the numerator.

 

Second is:

TotalCIs = counta('All CIs'[CI Identifier])

This is total # of CIs available. This will be the denominator

Both of these give correct values. 

 

This third one:

% Updated = [UpdatedTotal] / [TotalCIs]   

 

Is not giving me a value that even makes sense once i add the Reporting Month on the Axis. I've tried adding the column Reporting Month from the "All CIs" table, and from the "Config Metrics - Updated".

When I select the Reporting month column from "All CIs" table, it only shows a value for January (and it is incorrect)

When I select the Reporting month column from "Config Metrics - Updated", it says Infinity.

 

I'm unsure what to do next so that it is correct.

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Lenihan,

 

Since you have the relationship between these tables, you can calculate based on date table.

 

	% Updated =COUNTA('Config Metrics - Updated'[CI Identifier]) /CALCULATE(COUNTA('All CIs'[CI Identifier]),RELATED(Date[report Month]))

 

 

in addition, you can also use current reporting month to calcualte.

 

	% Updated =
	var currMonth= max('Config Metrics - Updated'[Reporting Month])
	return
	COUNTAX(FILTER(ALL('Config Metrics - Updated'),'Config Metrics - Updated'[Reporting Month]=currMonth),[CI Identifier])
	/
	COUNTAX(FILTER(ALL('All CIs'),'All CIs'[Reporting Month]=currMonth),[CI Identifier])

 

 

If above is not help can you share some sample file?

 

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Lenihan,

 

Since you have the relationship between these tables, you can calculate based on date table.

 

	% Updated =COUNTA('Config Metrics - Updated'[CI Identifier]) /CALCULATE(COUNTA('All CIs'[CI Identifier]),RELATED(Date[report Month]))

 

 

in addition, you can also use current reporting month to calcualte.

 

	% Updated =
	var currMonth= max('Config Metrics - Updated'[Reporting Month])
	return
	COUNTAX(FILTER(ALL('Config Metrics - Updated'),'Config Metrics - Updated'[Reporting Month]=currMonth),[CI Identifier])
	/
	COUNTAX(FILTER(ALL('All CIs'),'All CIs'[Reporting Month]=currMonth),[CI Identifier])

 

 

If above is not help can you share some sample file?

 

Regards,

Xiaoxin Sheng

Thank you @Anonymous   The second function worked (first I had some errors with the ,RELATED section, but first worked great, and gave all the correct values. Thank you!

 

 

When i read your formula, it's like "Of course!".. but.. i know I never would have gotten to that point. This may help me with other measures I have to create too.

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.

Top Solution Authors