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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
TomSinAA
Helper III
Helper III

dax help

I have data in this format:

CategoryAreaRequirement
Cat1R11
Cat1R1 
Cat1R2 
Cat1R32
Cat1R43
Cat1R5 

 

I need to display the count and % of areas with and without requirements.  So that is looks like this:

AreaCount of Areas with no requirement%Count of Areas with requirement Total%
Cat1240%360%5100

 

Not sure how to approach this. 

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @TomSinAA 

You can refer to the following measure

Count of Areas with no requirement = var a=SELECTCOLUMNS(FILTER('Table',[Requirement]<>BLANK()),"a",[Area])
return CALCULATE(DISTINCTCOUNT('Table'[Area]),'Table'[Area] in a=FALSE())

Count of Areas with  requirement = DISTINCTCOUNT('Table'[Area])-[Count of Areas with no requirement]

Areas with no requiremen t% = DIVIDE([Count of Areas with no requirement],CALCULATE(DISTINCTCOUNT('Table'[Area])))

Areas with  requiremen t% = DIVIDE([Count of Areas with  requirement],CALCULATE(DISTINCTCOUNT('Table'[Area])))

Output

vxinruzhumsft_0-1690425818262.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xinruzhu-msft
Community Support
Community Support

Hi @TomSinAA 

You can refer to the following measure

Count of Areas with no requirement = var a=SELECTCOLUMNS(FILTER('Table',[Requirement]<>BLANK()),"a",[Area])
return CALCULATE(DISTINCTCOUNT('Table'[Area]),'Table'[Area] in a=FALSE())

Count of Areas with  requirement = DISTINCTCOUNT('Table'[Area])-[Count of Areas with no requirement]

Areas with no requiremen t% = DIVIDE([Count of Areas with no requirement],CALCULATE(DISTINCTCOUNT('Table'[Area])))

Areas with  requiremen t% = DIVIDE([Count of Areas with  requirement],CALCULATE(DISTINCTCOUNT('Table'[Area])))

Output

vxinruzhumsft_0-1690425818262.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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