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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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

2 REPLIES 2
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

 

Wow, thank you for this. Never would have found this out if not for this post. I had the same problem.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.