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
jcastr02
Post Prodigy
Post Prodigy

Days of week count from three different tables

I have three different tables with requests coming into our business.  I need to be able to visually show on graph the number of requests depending on the day of the week.  Each table has a column for day of the week (Mon, Tues, Wed, etc.) but I don't know how to tie/count all three together so the graph just shows as total count.  

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @jcastr02 

You can create a table in your model with the following code

Days = 
DATATABLE (
    "Day of week", STRING,
    "Order", INTEGER,
    {
        { "Sun", 1 },
        { "Mon", 2 },
        { "Tue", 3 },
	{ "Wed", 4 },
	{ "Thu", 5 },
	{ "Fri", 6 },
	{ "Sat", 7 }
    }
)

Then join each of your data tables to this Days table.  Then you pull the [Day of week] from this days table into your visual and that will let you count, by day, the number of lines in each of your 3 data tables.

daysofweek.jpg

 

I have attached my sample file for you to look at.

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

Hello @jcastr02 

You can create a table in your model with the following code

Days = 
DATATABLE (
    "Day of week", STRING,
    "Order", INTEGER,
    {
        { "Sun", 1 },
        { "Mon", 2 },
        { "Tue", 3 },
	{ "Wed", 4 },
	{ "Thu", 5 },
	{ "Fri", 6 },
	{ "Sat", 7 }
    }
)

Then join each of your data tables to this Days table.  Then you pull the [Day of week] from this days table into your visual and that will let you count, by day, the number of lines in each of your 3 data tables.

daysofweek.jpg

 

I have attached my sample file for you to look at.

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