cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Three tables with one common date column

Hi Team,

 

I have attached format database of power sector, Where master table have the records of user activation date/Billinfo has the records on monthly basis bill generation/ same way payment has the records on monthly basis payment details.

 

Once consumer gets activated, we generate bill for user on every month & user also may or may not pay every month(As user can 02 month bill on at once as well)

 

Now as per the attach tables, i want to get the details for every month, for example nov month i need below,

 

Total users - 9

Biiled user - 8

Paid user -  7 

 

how to acheive this.

 

Thanks,

Ashraf 

 
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: Three tables with one common date column

You can create date dimension and join all three dates with that. One active other inactive. Using userelation, you can create measures that can tell based on each date active, billed and paied.

check how to use multiple date at :https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Community Support
Community Support

Re: Three tables with one common date column

Hi,

 

You can try to use SelectColumns function to create three tables which have the same number of columns.

And then you can union them and follow the steps in my previous reply.

 

Best Regards,

Giotto Zhi

 

View solution in original post

7 REPLIES 7
Highlighted
Helper II
Helper II

Re: Three tables with one common date column

Master BillInfo Payment
UserNoActive date UserNoBill Date UserNoPayment Date
11001-Sep-19 110015-Oct-19 110025-Oct-19
11011-Oct-19 110116-Oct-19 110126-Oct-19
11022-Oct-19 110215-Oct-19 110225-Oct-19
11033-Oct-19 110318-Oct-19 110326-Oct-19
11044-Oct-19 110415-Oct-19 110425-Oct-19
11055-Oct-19 110514-Oct-19 110527-Oct-19
11066-Oct-19 110618-Oct-19 110025-Nov-19
11077-Oct-19 110015-Nov-19 110126-Nov-19
11087-Nov-19 110116-Nov-19 110225-Nov-19
Result 110217-Nov-19 110327-Nov-19
Total Users 9 110318-Nov-19 110428-Nov-19
   110419-Nov-19 110525-Nov-19
MonthUsers Billed  110520-Nov-19 110625-Nov-19
Oct7 110617-Nov-19 110025-Dec-19
Nov8 110718-Nov-19 110126-Dec-19
Dec9 110015-Dec-19 110225-Dec-19
   110116-Dec-19 110326-Dec-19
MonthUsers Billed  110215-Dec-19 110425-Dec-19
Oct6 110318-Dec-19 110527-Dec-19
Nov7 110415-Dec-19 110625-Dec-19
Dec9 110514-Dec-19 110726-Dec-19
   110615-Dec-19 110825-Dec-19
   110718-Dec-19   
   110814-Dec-19   
Highlighted
Super User IX
Super User IX

Re: Three tables with one common date column

You can create date dimension and join all three dates with that. One active other inactive. Using userelation, you can create measures that can tell based on each date active, billed and paied.

check how to use multiple date at :https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Community Support
Community Support

Re: Three tables with one common date column

Hi,

 

Please try these measures:

Total Users = COUNTROWS(DISTINCT(Master[UserNo]))
COUNTROWS(BillInfo)
User Paid = COUNTROWS(Payment)

And it shows:

21.PNG

Best Regards,

Giotto Zhi

Highlighted
Helper II
Helper II

Re: Three tables with one common date column

@v-gizhi-msft  ..if i filter this by month, It gives me total user For Sep -1, Oct - 7 & Nov -1

but in actual it should be Sep -1, Oct - 8 & Nov -9 (need total no of user till date for master table & for bill & paid only distinct count of that month)

Highlighted
Community Support
Community Support

Re: Three tables with one common date column

Hi,

 

Please try to create a calculated table:

Table = UNION(BillInfo,Payment,Master)

Then change the original total measure to this:

Total Users = CALCULATE(DISTINCTCOUNT('Table'[UserNo]),ALLEXCEPT('Table','Table'[Bill Date].[Month]))

And the result shows:

32.PNG

 

Best Regards,

Giotto Zhi

Highlighted
Helper II
Helper II

Re: Three tables with one common date column

@v-gizhi-msft  For union all tables must have same no of columns which i don't have in my database

Highlighted
Community Support
Community Support

Re: Three tables with one common date column

Hi,

 

You can try to use SelectColumns function to create three tables which have the same number of columns.

And then you can union them and follow the steps in my previous reply.

 

Best Regards,

Giotto Zhi

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors