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
john_elmasry
Frequent Visitor

All Selected is not working properly, I have to include another Column

Hello,

I have a fact table that has multiple colums:

Item,Period_Name,Period_ID,Sales

Period name is like Jan 2022 , Feb 2022 etc

Period_ID is like 202201 , 202202 etc

 

I created one slicer in the dashboard that has "Period_Name" Field and created 1 grid in the dashboard in which I want to include 4 columns:  Item, Period, Sales Value, Sales value (for the all selected periods) , Sales Value (for all the periods selected and unselected)

 

I created the measures like this

Total Value Sales = CALCULATE(SUM(Fact_Sales[Value Sales]))
Total Value Sales (Selected Period) = CALCULATE([Total Value Sales], ALLSELECTED(Fact_Sales[Period]))
Total Value Sales (Ignore Period) = CALCULATE([Total Value Sales], ALL(Fact_Sales[Period]))
 
But I got wrong results like the image
john_elmasry_0-1680263610014.png

 

I tried so much to solve it and solved successfully by changing in the measures

 

Total Value Sales (Selected Period) = CALCULATE([Total Value Sales], ALLSELECTED(Fact_Sales[Period]),ALLSELECTED(Fact_Sales[PERIOD_ID]))
Total Value Sales (Ignore Period) = CALCULATE([Total Value Sales], ALL(Fact_Sales[Period]),ALL(Fact_Sales[PERIOD_ID]))
john_elmasry_1-1680263691156.png
As you can see, numbers now are reflecting correctly... but I am unable to understand the behaviour, why it didn't work although I am not using this Period_ID column anywhere? 
 
also I wanted to create another sheet with dummy data to upload here to the community to make things easier, but surprisingly it worked successfully without adding the second condition.
 
Does anyone have a clue?
 
Thanks.
John Elmasry
 
1 ACCEPTED SOLUTION
john_elmasry
Frequent Visitor

I found the solution to whom it may concern.

The reason is because the Period Column was sorted by Period ID Column, in this situation you have to include both columns in ALL and ALLSELECTED.

Refer to this video

https://youtu.be/rvpKSH3zRcg?t=465

 

View solution in original post

1 REPLY 1
john_elmasry
Frequent Visitor

I found the solution to whom it may concern.

The reason is because the Period Column was sorted by Period ID Column, in this situation you have to include both columns in ALL and ALLSELECTED.

Refer to this video

https://youtu.be/rvpKSH3zRcg?t=465

 

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.

Top Solution Authors