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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
pmcinnis
Helper III
Helper III

Need DAX script to make table

I need to produce the table 'Desired Output' from the data in the tables 'Results' and 'Guidelines'.

  • 'Results' is a table of chemical concentration results.
    • 'Factory' is the factory where the chemical was sampled.
    • 'result type' is the type of sample.
  • 'Guidelines' is a table of health guidelines for the various chemicals. Chemical concentration results should be below the guidelines to ensure public safety.
  • The table 'Desired Output' presents the number of results above guideline for each chemical at each factory, for result types K and L but not result type J.
    • Many chemicals don't have guidelines, so those chemicals are left out of the table 'Desired Output'
    • Where the number of results above guideline for a given chemical at a given factory (for result types K and L) is zero,  the entry in 'Desired Output' is a blank rather than zero
    • Where a chemical has no results above guideline at any factory (for result types K and L), that chemical is left out of the table 'Desired Output'. In the example below, chemicals c and d are left out of 'Desired Output' for this reason.

Exceedance counts by parameter at each DWS.PNG

 

 

 

4 REPLIES 4
FrankAT
Community Champion
Community Champion

Hi @pmcinnis,

following solution, see figue.

For the other two measure change only the marked parts to 'b' and 'e'.

 

19-06-_2020_23-47-09.jpg


Regards FrankAT

Hi Frank, thanks for the response and the effort you put into it. It was my oversight to not mention that there are 450 chemicals and I'm unable to do them one-by-one. I was hoping get a solution that does all chemicals at once.

FrankAT
Community Champion
Community Champion

Hi @pmcinnis,

here is the solution you need, I hope ;-):

 

Parts of the solutionParts of the solution

 

 Regards FrankAT

Thanks Frank, much appreciated. Many of the chemicals don't have guidelines and as a result the guidelines table doesn't have rows for those chemicals i.e. they don't appear in the guidelines table at all.  There are 450 chemicals and the guidelines table has only 130 guidelines. Will this script still work? Thanks again.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.