cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Snowy34 Regular Visitor
Regular Visitor

Better Measure options?

Good afternoon all,

 

I'm using the below measure to get a sum but I'm using the same measure 11 times and I was hoping I could maybe use one to give me the same information...

 

measure 1

1 Day 249 =
CALCULATE(
    DISTINCTCOUNT('DOP-055'[Order No]),
    'DOP-055'[Overall Performance 249] IN { 1 }
)
 
measure 2
1 Day 222 =
CALCULATE(
    DISTINCTCOUNT('DOP-055'[Order No]),
    'DOP-055'[Overall Performance 222] IN { 1 }
)
 
Regards 
1 ACCEPTED SOLUTION

Accepted Solutions
v-jayw-msft Established Member
Established Member

Re: Better Measure options?

Hi @Snowy34 ,

 

Are you want the sum of [222] for each [Warehouse]?

If so, you just need to create a slicer base on [Warehouse] and refer the below measure to modify your measure:
Overall Performance =
VAR a =
CALCULATE (
SUM ( 'Date Table formula'[222] ),
FILTER (
'Date Table formula',
AND (
'Date Table formula'[DayMonthYear] >= 'DOP-055'[Customer Requested Date],
'Date Table formula'[DayMonthYear] <= 'DOP-055'[Depature Date.1] - 1
)
)
)
RETURN
IF ( ISBLANK ( a ), "NA", a )
The result would be shown as below:

1.PNG

2.PNG3.PNG

Hopefully works for you.

 

Best Regards,

Jay

View solution in original post

5 REPLIES 5
Snowy34 Regular Visitor
Regular Visitor

Re: Better Measure options?

Good day all,

 

Here is an example of how the data looks like, in this case I would need two measure and in my case, I have 11 

uM1pEua

 

 

v-jayw-msft Established Member
Established Member

Re: Better Measure options?

Hi @Snowy34 ,

 

If I understand you correctly, please use Unpivot function in Query Editor.
Here’s my sample data:

1.PNG

Please check following steps as below and see if the result achieve your expectation:

1. Unpivot table and apply change:

2.PNG

    Result would be shown as below:

3.PNG

2. Create measure:

    Measure = DISTINCTCOUNT('Table (2)'[No])

3. Create slicer to filter data:

4.PNG5.PNG

Hopefully works for you.

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

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

 

Snowy34 Regular Visitor
Regular Visitor

Re: Better Measure options?

Good day @v-jayw-msft 

 

The issue with that suggestion is my the data on that table is generated using the below column so it doesn't show up in the queries editor. 

 

Overall Performance 249 = IF('DOP-055'[Warehouse]="249",CALCULATE(SUM('Date Table formula'[222]),FILTER('Date Table formula',AND('Date Table formula'[DayMonthYear]>='DOP-055'[Customer Requested Date],'Date Table formula'[DayMonthYear]<='DOP-055'[Depature Date.1]-1))))
 
Also, aside question regarding the above formula, I would like to add also a return of 'NA' if the result is returned as BLANK, how would I add that into this formula.
v-jayw-msft Established Member
Established Member

Re: Better Measure options?

Hi @Snowy34 ,

 

Are you want the sum of [222] for each [Warehouse]?

If so, you just need to create a slicer base on [Warehouse] and refer the below measure to modify your measure:
Overall Performance =
VAR a =
CALCULATE (
SUM ( 'Date Table formula'[222] ),
FILTER (
'Date Table formula',
AND (
'Date Table formula'[DayMonthYear] >= 'DOP-055'[Customer Requested Date],
'Date Table formula'[DayMonthYear] <= 'DOP-055'[Depature Date.1] - 1
)
)
)
RETURN
IF ( ISBLANK ( a ), "NA", a )
The result would be shown as below:

1.PNG

2.PNG3.PNG

Hopefully works for you.

 

Best Regards,

Jay

View solution in original post

Snowy34 Regular Visitor
Regular Visitor

Re: Better Measure options?

Thank you @v-jayw-msft  for helping I got it working the way i want 🙂 

Helpful resources

Announcements
New Ranks and Rank Icons in 2020

New Ranks and Rank Icons in 2020

Read the announcement for more information!

New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

November 2019 Community Highlights

November 2019 Community Highlights

Get an overview of the events and great community content from November.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)