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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
giovissimo
Helper I
Helper I

Default value for box

Hello everybody,

 

I hope someone can help me solve this problem.

I wrote the following code:

 

OrderedLastWeek =
CALCULATE (
COUNT ( Orders[OrderID] ),
FILTER (
ALL(
Orders[OrderYear],
Orders[OrderWeek]),
Orders[OrderYear] = 2022
),
Orders[OrderWeek] = MAX ( Orders[OrderWeek] )
)

 

to count the orders issued in the last week nationwide, and put the abobe measure in a box.

Then, in the same page I put a slicer called "Region" so that the box count only the orders issued in that particular region.

The thing is, the box was supposed to show the total amount of the issued orders if no selection was made on the Region filter, instead it only works is a selection is made, otherwise I get a Blank.

Since I didn't filter the Region, I expected the measure to work as it was meant. 

What's wrong with my code ?

 

Giovanni

2 REPLIES 2
tamerj1
Super User
Super User

Hi @giovissimo 
Please provide more details about your data model.

Hi tamerj1,

 

there's only one table as a data source, i.e. the Orders table.

Orders are issued by purchasing departments of every region (there are 20 regions) and, apart from order details which are not of interest here, the only parameters to be taken into account are the OrderDate and OrderID. I added two simple calculated columns to the table in order to have the week number and the year the order was issued, because the request was that the report showed the orders issued in the latest week, both nationwide and for every region. But, as I mentioned above, if no selection is made on the Region slicer, no data is shown in the box containing the measure (and the same happens if all the regions are selected through the CRTL key, or if the "Select all" is enabled and selected for that matter).

I hope I answered your request.

 

Giovanni

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (27)