cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

Define measure for data

Hi

 

I wish to have one measure which filter one region from results and show test message or blank cell. 

 

below table has required details and "Results" column should be the measure results

 

Table got linked with Emp ID and Date in fact table

 

RegionEmpIDUTZResults
CALA110%10%
GGM250%50%
EMEA345%UTZ not available
    
1 ACCEPTED SOLUTION

Hi ,

 

If you want 0 instead of the string the below measure can be used:

Result with 0 = SWITCH(True(),RegionTable[Region] = "EMEA",0,CALCULATE(AVERAGE(RegionTable[UTZ]),ALLEXCEPT(RegionTable,RegionTable[Region])))

 

As you need the calculation to happen against each value, I am afraid the measure won't do in this case.

You can find the file here for your reference and it contains both ways with string and 0.

 

Thanks

View solution in original post

5 REPLIES 5
Solution Supplier
Solution Supplier

Hi @Amardeep100115 ,

 

You can create a calculated column and use the following DAX:

Result =
SWITCH (
    TRUE (),
    RegionTable[Region] = "EMEA", "UTZ not available",
    FORMAT (
        CALCULATE (
            AVERAGE ( RegionTable[UTZ] ),
            ALLEXCEPT ( RegionTable, RegionTable[Region] )
        ),
        "Fixed"
    )
)

The result would be something like:

PC2790_0-1611382378795.png

I hope this works for you

Could you please use zero instate of  

"UTZ not available"

so t will show results in number also please help with meaure not column. 

 

If possible please share PBIX file

 

Thanks in advance 

Hi ,

 

If you want 0 instead of the string the below measure can be used:

Result with 0 = SWITCH(True(),RegionTable[Region] = "EMEA",0,CALCULATE(AVERAGE(RegionTable[UTZ]),ALLEXCEPT(RegionTable,RegionTable[Region])))

 

As you need the calculation to happen against each value, I am afraid the measure won't do in this case.

You can find the file here for your reference and it contains both ways with string and 0.

 

Thanks

View solution in original post

Super User III
Super User III

Hi @Amardeep100115 

Sorry it's not clear what you want. Can you please provide the rest of your data and a clearer explanation of what you are trying to do.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi 

 

I have table like shared above query and  wish to have a measure which gives me an average of UTZ column and i want to create measure which will give me average of those rows which don't have EMEA in region column.

 

rest all regions average should be replact in measure

 

Hope i am clear on my query

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

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

Top Solution Authors
Top Kudoed Authors