cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
RJM9o
New Member

Can you help me decipher a DAX formula -> if(countrows(values(dim_country[planning market]))>1, BLAN

Traffic SOB = if(countrows(values(dim_country[planning market]))>1, BLANK(), DIVIDE([Traffic], CALCULATE([Traffic],ALL('dim_dm-channels')))) 

 

 

Hi, I found this formula in a report I got to maintain;

The formula aims to calculate the share of traffic of different marketing channels. 

The logic behind the second element of the if statement, DIVIDE function, is clear but I am guessing what the original report owner (I cannot reach out to him) wanted to achive with the first condition -> countrows(values(dim_country[planning market]))>1, BLANK()

Any idea about how to interpret it? Thanks

 

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

That is checking that there is no more than 1 value in the current filter context for the planning market, either because no filter has been applied to the column or if e.g. it is the total or subtotal row of a table or matrix.

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

That is checking that there is no more than 1 value in the current filter context for the planning market, either because no filter has been applied to the column or if e.g. it is the total or subtotal row of a table or matrix.

Thanks for your answer. So that means it can be equivalent to a COUNTDISTINCT?

Yes, as long as CALCULATE is used to force context transition.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors