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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Count a measure ActiveProductPath

Hi all,

 

I need help with the following issue,

 

I have a measure which calculates the ActiveProductPath from each customer, see https://www.dropbox.com/s/2l02agyrk7dzk40/ActiveProductPathVirtualv3.pbix?dl=0

 

Community.png

I want to count the path for each day, for example, on 10th April 2019 there are 3 paths, A, B and A,B so the result should be:

 

Path  Number

A           1

B           1

A, B       1

 

Can someone help me?

 

Thanks in advance,

 

Cor

 

 

2 ACCEPTED SOLUTIONS
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I create some sample data to test.

Here is my test table:

1.png

please take following steps:

1)Create a measure:

Measure = COUNTROWS(FILTER(SUMMARIZE('DummyFile',DummyFile[Customer],"Path2",[ActiveProductPath]),[Path2] in FILTERS('Table'[Value])))

2)Create a table by ‘Enter Data’:

2.png

3)Use a date slicer to filter and the result shows:

3.png

4)The result can also be shown as matrix to display the count of A/B/A,B for all dates:

4.png

Here is my test pbix file

pbix 

 

Best Regards,

Giotto Zhi

View solution in original post

Hi,

 

For your confusion, I extract ‘summarize’ of the measure I provided and add a specified date to create a calculated table:

Table 2 = CALCULATETABLE(SUMMARIZE('DummyFile',DummyFile[Customer],"Path2",[ActiveProductPath]),FILTER('ref Ref_Date','ref Ref_Date'[FullDate]=DATE(2019,4,30)))

31.png

FILTERS ('Table'[Value]) means choosing the value you selected, like this:

32.png

And [Path2] IN FILTERS ( 'Table'[Value] ) means checking whether the value of [Path2] is equal to ‘A’ or ‘B’ as the above chosen value.

And then count the return table rows, using a ‘Card’ visual to show the original measure:

33.png

When you choose [value] as columns and Measure as Values in ‘Matrix’ visual, it shows:

34.png

 

Best Regards,

Giotto Zhi

View solution in original post

6 REPLIES 6
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I create some sample data to test.

Here is my test table:

1.png

please take following steps:

1)Create a measure:

Measure = COUNTROWS(FILTER(SUMMARIZE('DummyFile',DummyFile[Customer],"Path2",[ActiveProductPath]),[Path2] in FILTERS('Table'[Value])))

2)Create a table by ‘Enter Data’:

2.png

3)Use a date slicer to filter and the result shows:

3.png

4)The result can also be shown as matrix to display the count of A/B/A,B for all dates:

4.png

Here is my test pbix file

pbix 

 

Best Regards,

Giotto Zhi

Anonymous
Not applicable

Hi Giotto,

 

Can you explain the measure Measure = COUNTROWS(FILTER(SUMMARIZE('DummyFile',DummyFile[Customer],"Path2",[ActiveProductPath]),[Path2] in FILTERS('Table'[Value]))) to me?

I understand the part "SUMMARIZE('DummyFile',DummyFile[Customer],"Path2",[ActiveProductPath])", can you explain what "COUNTROWS(FILTER(" and FILTERS('Table'[Value]) does?

 

Thanks in advance,

 

Cor

 

Hi,

 

For your confusion, I extract ‘summarize’ of the measure I provided and add a specified date to create a calculated table:

Table 2 = CALCULATETABLE(SUMMARIZE('DummyFile',DummyFile[Customer],"Path2",[ActiveProductPath]),FILTER('ref Ref_Date','ref Ref_Date'[FullDate]=DATE(2019,4,30)))

31.png

FILTERS ('Table'[Value]) means choosing the value you selected, like this:

32.png

And [Path2] IN FILTERS ( 'Table'[Value] ) means checking whether the value of [Path2] is equal to ‘A’ or ‘B’ as the above chosen value.

And then count the return table rows, using a ‘Card’ visual to show the original measure:

33.png

When you choose [value] as columns and Measure as Values in ‘Matrix’ visual, it shows:

34.png

 

Best Regards,

Giotto Zhi

Anonymous
Not applicable

Hi Giotto,

 

Thank you very much! This is the solution I was looking for! 🙂

 

Best regards,


Cor

 

@v-gizhi-msft 

Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

Please, can you try to explain your requirement as I'm struggling to understand?

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

 

 

Anonymous
Not applicable

Of course, @Mariusz 😀

 

I have the following measure:

ActiveProductPath = CALCULATE(CONCATENATEX(VALUES(DummyFile[Product]);DummyFile[Product]; ", ";DummyFile[Product];ASC);
   FILTER(DummyFile;DummyFile[From] <= MAX('ref Ref_Date'[FullDate]));
   FILTER(DummyFile; DummyFile[To] >= max('ref Ref_Date'[FullDate]) ) )
 
That measure calculates for every date the "path" of active products.
 
Now I want for each day the number of the several paths. The problem is that I have to count a "measure" and I don't know how to do that.
 
For example date 29-03-2019, there a 3 paths, A, B and A,B so the end result should be:
 
Path Number
A 1
B 1
A, B 1
 
I want to use the technique for another dataset for approximately 6.000 different "paths"....
 
Do you understand the issue?
 
Regards,
 
Cor
 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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