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

Why result is wrong when slicer select a value in dropdown

Hi Power BI team,

 

I posted this message yesterday but it seems it does not appear in the forum and I will repost again.

When I select "All" in the Sector slicer, all the reporting view generate the correct figure, and everything is fine... until....

 

 

P1.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PROBLEM:

Until when I select a specific value in the Sector slicer, ....

 

Problem 1 - the sector percentage figure section generate wrong value (see Q1). In this example, I select resources in the sector dropdown, and the Resource percentage is 100% which is correct but others are wrong.

Problem 2 - in Q2, there should be on 7 records with all having Target machine status of "Assessed" but the table provides more than 7 rows.

 

My Dax formula:

 

All individual sector percentage is computed with individual Nominator divided by a common denominator

 

Denominator - 

MeasureTotal = Calculate(Countrows('Asssessment_Action_20190219'),
                          DATESINPERIOD('Asssessment_Action_20190219'[Last Assessment Date1].[Date], TODAY(),-13,MONTH)
                           )
 
Nominator - 
MeasureResource = Calculate(Countrows('Asssessment_Action_20190219'),
                                                 'Asssessment_Action_20190219'[Sector]="RESOURCES",
                                                  DATESINPERIOD('Asssessment_Action_20190219'[Last Assessment Date1].[Date], TODAY(),-13,MONTH))/ [MeasureTotal]
 
 
Hope you can provide a clue. I have tried using ALLExcept and it doesn't help.
 
Thanks
Tuff
 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tuffy Regular Visitor
Regular Visitor

Re: Why result is wrong when slicer select a value in dropdown

Hi Cheenu Singh,

 

I managed to find the solution. It is my Dax problem.

The correct DAX should be 

MeasureResource = Calculate(Countrows(filter('Asssessment_Action_20190219',  
                                 'Asssessment_Action_20190219'[Sector]="RESOURCES")),

                              DATESINPERIOD('Asssessment_Action_20190219'[Last Assessment Date1].[Date], TODAY(),-13,MONTH))/ [MeasureTotal]

 

I will close this issue

thanks.

2 REPLIES 2
Super User
Super User

Re: Why result is wrong when slicer select a value in dropdown

Hi @Tuffy 

 

 

It will be good if you can share data and pbix file on OneDrive / Google Drive and post the link here to better understand and arrive at a solution.

 

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!
Tuffy Regular Visitor
Regular Visitor

Re: Why result is wrong when slicer select a value in dropdown

Hi Cheenu Singh,

 

I managed to find the solution. It is my Dax problem.

The correct DAX should be 

MeasureResource = Calculate(Countrows(filter('Asssessment_Action_20190219',  
                                 'Asssessment_Action_20190219'[Sector]="RESOURCES")),

                              DATESINPERIOD('Asssessment_Action_20190219'[Last Assessment Date1].[Date], TODAY(),-13,MONTH))/ [MeasureTotal]

 

I will close this issue

thanks.