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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors